Any Ideas, why this is not valid?
package en.codegym.task.jdk13.task06.task0634;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
/*
Chess board
*/
public class Solution {
public static char[][] array;
public static void main(String[] args) throws IOException {
//write your code here
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(bf.readLine());
array = new char[n][n];
boolean binary = true;
for (int i = 0; i< n; i++){
for(int i1 = 0; i1<n ;i1++){
array[i][i1] = binary ? '#' : ' ';
binary = !binary;
}
}
for (char[] i : array){
for(char i1 : i){
System.out.print(i1+ " ");
}
System.out.println();
}
}
}