Iklan

Using Array Integer Variable in Java Programming Language


This is how to use Array Integer Variable in Java Programming Language.

 

package tes2;

public class arrayTutorial {
public static void main(String[] args) {
int arrInt[] = new int[5];
arrInt[0] = 1;
System.out.println(“0 = “+arrInt[0]);
int i = 1;
while(i<=4) {
arrInt[i] = i + 1;
System.out.print(i+” = “);
System.out.println(arrInt[i]);

i++ ;
}

System.out.println(arrInt[0]+arrInt[1]+arrInt[2]+arrInt[3]);
}

}

Iklan

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: