I have a problem trying to compile this exercise in Java, I use the console to compile and the error it throws at me is something like this: Can not convert the data type String to String [] [] How should I Then make the statements?
/*
Crea un programa que cree un array de 5x5 caracteres, lo rellene con puntos,
excepto la segunda fila, que estará rellena de letras "A" y luego muestra el
contenido del array en pantalla. Deberá aparecer algo como:
.....
AAAAA
.....
.....
.....
*/
class ejercicio58 {
public static void main(String[] args) {
String[][] m = new String[5][5];
for (int i = 0; i < 5; i++) {
for (int j = 0; j < 5; j++) {
if(i==1)
m[j] = "A";
else
m[j] = ".";
}
if(i==1)
m[i] = "A";
else
m[i] = ".";
}
for (int i = 0; i<5; i++) {
System.out.print(m[i]);
for (int j = 0; j<5; j++) {
System.out.print(m[j]);
}
System.out.println();
}
}
}