title: 2D Arrays Battleship place random ships
body: <p><strong>Hi, I just started to create a battleship game and I would like to know how to place random ships in my 2D Array. Here is the code for 2D Array.</strong></p>
  
  <pre><code>public class javaapplication24 {
  
      public static void main(String[] args) {
          int[][] table = new int[10][10];
          int i,j,k;
          for(i=0;i&lt;table.length;i++){
              for(j=0;j&lt;table.length;j++){
                  System.out.print(table[i][j]+" ");
              }
              System.out.println();
          }
      }
  }
  </code></pre>