Menampilkan buku alamat
public class BukuAlamat {
public static void main( String[] args ){
String[][][] data = {{{"Noni" , "266-2627" , "Jogja"},
{"Faisal" , "274-2726" , "Semarang"},
{"Rakhma" , "188-1808" , "Banjarmasin"}}};
for (int i=0; i< data.length; i++)//
{
System.out.println("Nama : " + data[i][0][0]);//
System.out.println("Telepon : " + data[i][0][1]);
System.out.println("Alamat : " + data[i][0][2]);
System.out.println("--------------------------------");
System.out.println("Nama : " + data[i][1][0]);//
System.out.println("Telepon : " + data[i][1][1]);
System.out.println("Alamat : " + data[i][1][2]);
System.out.println("--------------------------------");
System.out.println("Nama : " + data[i][2][0]);//
System.out.println("Telepon : " + data[i][2][1]);
System.out.println("Alamat : " + data[i][2][2]);
System.out.println("--------------------------------");}}}
0 komentar:
Posting Komentar