Now I have problems filling the array with spaces. Whenever I use the array fill method, I get an exception. I have now excluded the rest of the code and included only those that cause problems. Here. Note that I'm new to java, so don't be angry if this is too easy a question. I searched here and found nothing.
public class board
{
public static void main(String args[])
{
char board [][] = new char [6][7];
int column=0;
int row=0;
java.util.Arrays.fill(board,' ');
}
}
Exception indicated
An exception in the thread "main" java.lang.ArrayStoreException:
java.lang.Character
in java.util.Arrays.fill (Arrays.java:2710)
in java.util.Arrays.fill (Arrays.java:2685)
on board. main (board.java:26)
source
share