Question: ```
public class Environment {
    //variables
    RoundingStage[][] land;
    int horizontalStreets;
    int verticalStreets;

   public Environment(RoundingStage[][] grid) {
       this.horizontalStreets = grid.length;
       this.verticalStreets = grid[0].length;
       land = new RoundingStage[horizontalStreets][verticalStreets];

       for (int i = 0 ; i <= horizontalStreets ; i++)
           for (int j = 0 ; j <= verticalStreets ; j++)
               land[i][j] = grid[i][j];
    }
   public Environment(Environment env) {
        this.horizontalStreets = env.horizontalStreets;
        this.verticalStreets = env.verticalStreets;
        land = new RoundingStage[horizontalStreets][verticalStreets];

        for (int i = 0 ; i <= horizontalStreets ; i++)
            for (int j=0 ; j <= verticalStreets ; j++)
                land[i][j] = env.land[i][j];
    }

```

Can someone tell me why i am getting ArrayOutOfBound when i use this function, I've tried every combination of +1, -1, i need some help please :D

```
public RoundingStage valueInPosition(int rHor, int rVer) {
    return land[rHor-1][rVer-1];    
    }

```

Answer: 
You should actually be getting that out of bound exception in those constructors. Those nested loops using `i` and `j` as iterators should be looping until `i < horizontalStreets` and `j <verticalStreets`, not `<=` as currently posted. Java array indices are 0-based.
I'm not totally clear on your question, but I'm going to assume you mean, "Why does calling the constructor result in an ArrayOutOfBound exception getting thrown?" If that's not what you meant, let me know.

My guess for the exception is that the termination condition for the for loop is i <= horizontalStreets when it should be i < horizontalStreets, and likewise for vertical.

because since array indices start at zero, trying to reference array[array.length()] will try to get an entry that's one after the end of the array, resulting in an exception.