Cetak Nilai Array PerBaris

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package cetakArrayPerBaris;

/**
*
* @author Angga
*/
public class cetakArrayPerBaris {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
//declare and construct a 20 array
int [][] uneven = {{1,9,4},{0,2},{0,1,2,3,4}};
//print out the array
for (int row=0;row<uneven.length;row++){ //changes row
System.out.print(“Row” + row + “:”);
for(int col=0;col<uneven[row].length;col++) //changes column
System.out.print(uneven[row][col]+””);
System.out.println();
}
}
}

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 )

Foto Google

You are commenting using your Google 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 )

Connecting to %s