Tugas Pemograman 2 ( Array 2 Dimensi) cara 2


/**
* Write a description of class Array2D_cara2 here.
*
* @author (Hasan Mualim)
* @version (04072010)
*/
public class Array2D_cara2
{
public static void main(String[]args){
int[][]arrx={{10,20,30},{40,50,60},{70,80,90}};
//cara dua(2) Array 2 Dimensi
//Dimensi ukuran 3*3
System.out.println(“Nilai arrx[0]:”+ arrx[0][0]);
System.out.println(“Nilai arrx[0]:”+ arrx[0][1]);
System.out.println(“Nilai arrx[0]:”+ arrx[0][2]);
System.out.println(“Nilai arrx[1]:”+ arrx[1][0]);
System.out.println(“Nilai arrx[1]:”+ arrx[1][1]);
System.out.println(“Nilai arrx[1]:”+ arrx[1][2]);
System.out.println(“Nilai arrx[2]:”+ arrx[2][0]);
System.out.println(“Nilai arrx[2]:”+ arrx[2][1]);
System.out.println(“Nilai arrx[2]:”+ arrx[2][2]);
}
}

Hasil Outputnya :

Nilai arrx[0]:10

Nilai arrx[0]:20

Nilai arrx[0]:30

Nilai arrx[1]:40

Nilai arrx[1]:50

Nilai arrx[1]:60

Nilai arrx[2]:70

Nilai arrx[2]:80

Nilai arrx[2]:90

Tentang hasanmualim

Wong Ndeso
Pos ini dipublikasikan di Tak Berkategori. Tandai permalink.

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