Minggu, 18 April 2010

Java array3

class Array3{

public static void main(String[] args) {
char[][][] tabChar = {
{
{'a', 'b', 'c'},
{'d', 'e', 'f'},
{'g', 'h', 'i'}
}, {
{'j','k','l'},
{'m', 'n', 'o'},
{'p', 'q', 'r'}
}, {
{'s', 't', 'u'},
{'v', 'w', 'x'},
{'y', 'z', '0'}
}
};


System.out.println("isi array :");
int i;
int j;
int k;

for(i=0; i<3; i++){
/* perulangan indeks pertama */
for(j=0; j<3; j++){
/* perulangan indeks kedua */
for(k=0; k<3; k++){
/* perulangan indeks ketiga */
System.out.print (tabChar[i][j][k] + " ");
}
System.out.println();
}
System.out.println();
}

}
}