Search:

Type: Posts; User: jugi

Search: Search took 0.27 seconds.

  1. Replies
    10
    Views
    1,883

    Re: Java 2d array problem

    can you give me a quick example please?
  2. Replies
    10
    Views
    1,883

    Re: Java 2d array problem

    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...
  3. Replies
    10
    Views
    1,883

    Re: Java 2d array problem

    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.
  4. Replies
    10
    Views
    1,883

    Re: Java 2d array problem

    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...
  5. Replies
    10
    Views
    1,883

    Java 2d array problem

    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...
Results 1 to 5 of 5