Why do I get an error in the for loop??
error: '.class' expected at the variable i
public class Main {
private static char[] [] readSecret(String nachricht, int n, int m) {
char[][] chars = new char[n][m];
For (int i = 0; i < n; i++){
For (int j = 0; j < m; j++){
chars[i] [j] = nachricht.charAt(i*n + j);
}
}
return chars;
}
public static void main(String[] args) {
if (args.length != 5)
{
System.out.println ("ERROR: Zu wenig Würfel");
return;
}
System.out.println (readSecret("alle meine Entchen", 3,6));
}
}