can you give me a quick example please?
Type: Posts; User: jugi
can you give me a quick example please?
Well, to give you some background about the program. It is practically a draughts game, and the game is almost complete. The bit that is giving me trouble is how to make the player eat the enemy's...
if i understood you well the array is defined as:
public static int[][] grid;
public Board() {
grid = new int[10][10];
}
Board is the constructor of my class.
If for example I try this code: System.out.println(grid[11][11]);
java.lang.ArrayIndexOutOfBoundsException: 11
at Board.setPieces(Board.java:33)
at Window.<init>(Window.java:33)
at...
I currently have a 2d array named grid which can store from 0-9 both included. Now if i try to access let's say grid[11][11], the program will give a NullPointerException. I tried this code but to no...