multidimensional array
2. Write a program to demonstrate multidimensional array in which you have to use a character instead of numbers.
The output should be something like:
A B C D
E F G H
I J K L
M N O P
solution:
class arraye {
public static void main(String[] args) {
char[][] TwoDarray = new char[5][5];
for (int i='A'; i<TwoDarray.length; i ) {
for (int j='A'; j<TwoDarray[i].length; j ) {
TwoDarray[i][j] = i;
System.out.print(" " TwoDarray[i][j]);
}
System.out.println("");
}
}
}
15.217/arraye.java:6: error: incompatible types: possible lossy conversion from int to char
TwoDarray[i][j] = i;
^
1 error
how to solve the code ffor above given program