Twitter Delicious Facebook Digg Stumbleupon Favorites More

Rabu, 04 Mei 2011

Contoh Program Array 1 D

Di bawah ini merupakan coding contoh program array 1 dimensi.

public class Array1D
{
  public static void main(String[] args)
  {
    int um []={17, 15, 12, 10, 19};
    String nm []={"Bunga","Rosdiana","Isni","Puji","Indah"};
    System.out.println("No Nama Umur");
    for(int i=0; i<5; i++)
    System.out.println((i+1)+" "+nm[i]+" "+um[i]);
  }
}

Outputnya akan tampil seperti gambar dibawah ini.

0 komentar:

Posting Komentar

 
Design by Free WordPress Themes | Bloggerized by Mahasewa - Premium Blogger Themes | Blogger Templates