Array

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

package program;

/**
 *
 * @author Administrator
 */
public class Array166 {
    public static void main(String[] args) {
        String[] kota;
        kota=new String[6];
        //mengisi data Array
        kota[0]="Pekanbaru";
        kota[1]="Jakarta";
        kota[2]="Bandung";
        kota[3]="Yogyakarta";
        kota[5]="Surabaya";
        //menampilkan isi eleman array
        System.out.println(kota[0]);
        System.out.println(kota[1]);
        System.out.println(kota[2]);
        System.out.println(kota[3]);
        System.out.println(kota[4]);
    }
}

0 komentar:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | SharePoint Demo