people!
So, I'm trying to make the Battleship game (classic!) in Java, with basic array and method knowledge.
I created a boolean board with 2 dimensions to place my boats and here's my code:

```
public void placerBateau(int x, int y, boolean dir, int longueur){
    int abs = this.x;
    int ord = this.y;
    this.longueur = longueur;

    if(!tabPlat[x][y]){
        if(dir){
            for(abs=ligne; ligne<ligne+this.longueur; abs++){
                tabPlat[abs][ord] = true;
            }
        } else {
            for(ord=colonne; colonne<colonne+this.longueur; ord++){
                tabPlat[abs][ord] = true;
            }
        }
    }
}

public class BatailleNavale {
public static void main(String [] args){
    boolean [][] tabPlat = { { false , false , false , false, false } , { false , false , false , false, false } , { false , false , false , false, false } , { false , false , false , false, false } , { false , false , false , false, false } ,  { false , false , false , false, false } };
    Plateau plat1 = new Plateau(tabPlat);
    plat1.placerBateau(2, 2, true, 2);
    plat1.tir(2, 2);
    System.out.println(plat1.toString());
}

```

Basically, to place my boat, I want to do a for cycle, and make true (change their initial value) every cell within the interval I defined in the for statement.
But I get this:

```
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 6
at Plateau.placerBateau(Plateau.java:39)
at BatailleNavale.main(BatailleNavale.java:6)

```

Which refers to the following line of code:

```
tabPlat[abs][ord] = true;

```

I understand what it stands for, but I don't get how can I have a problem with this.

PS - I'm very sorry for my english.