Friday, September 20, 2013

contoh array 2d pada java

contoh array 2d pada java

  1. buka netben
  2. pilih aplication java
  3. berinama ContohArray2
  4. tulis souce code berikut atau copy

public class ContohArray2 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        

        String[] namaKelas = {
            "Eko", "Kurniawan", "Khannedy"
        };
        
        System.out.println(namaKelas[0]);
        System.out.println(namaKelas[1]);
        System.out.println(namaKelas[2]);
        
        int panjang = namaKelas.length;
        System.out.println(panjang);
    }
}

No comments:

Post a Comment