Kamis, 24 Maret 2011

program Array

package classmain;

import java.util.Scanner;
class Main {
    public static void main(String[] args) {
    Scanner input = new Scanner (System.in);
        String[]nama=new String[3];
        for (int i=1;i<3;i++){
            System.out.print("Masukan Nilai"+i+":");
            nama [i]=input.next();
        }

        for(int a=1;a<3;a++){
            System.out.print(nama [a]+"");
        }
    }

}

0 komentar:

Posting Komentar