How to create a board game in Java?
<p>I have a Batlle-ship program project to do. I'm trying to figure out how to print a board game (NxN). </p>

<p>I was using a for-loop nested like this one:</p>

<pre><code>for(int i=0; i&lt;=10; i++){ 
    for(int=j=0; j&lt;=10; j++){
        System.out.println("-");
    }
    System.out.println("A B C D E F G H I J");
}
</code></pre>

<p>To print something like this:</p>

<pre><code>  A B C D E F G H I J
A - - - - - - - - - -
B - - - - - - - - - -
C - - - - - - - - - -
D - - - - - - - - - -
E - - - - - - - - - -
F - - - - - - - - - -
G - - - - - - - - - -
H - - - - - - - - - -
I - - - - - - - - - -
J - - - - - - - - - -
</code></pre>

<p>But there is something wrong because it doesn't show the board like that. I'll appreciate if someone can help identify what happens here.</p>