title: Java 2D array out of bounds
body: <p>Please bear with me here, I had hospital appointments this week and unfortunately I have NO idea how to use 2D arrays, and barley know arrays for that matter. I am trying to figure them out though. I am running this code below as a test for my project and am getting the following error</p>
  
  <pre><code>How many players? 2
  What is your name: alan
  What is your name: joseph
  Exception in thread "main" 27
  alan's Turn! 
  java.lang.ArrayIndexOutOfBoundsException: 0
  at ASgn8.main(ASgn8.java:41)
  </code></pre>
  
  <p>My code is Below</p>
  
  <pre><code>import java.util.Arrays;
  import java.util.Scanner;
  
  class ASgn8 {
  
  public static void main(String[] args)
  {
  
      Die[][] myDie = new Die[0][0];
  
      Scanner scan = new Scanner(System.in);
  
      System.out.print("How many players? ");
      int playerCount = scan.nextInt();
      scan.nextLine();
  
      String[] playerNames = new String[playerCount];
  
      for(int i = 0; i &lt; playerCount; i++)
      {
          System.out.print("What is your name: ");
          playerNames[i] = scan.nextLine();
  
      }
  
      int again = 1;
  
      int randomNum = (int)(Math.random() * (30-10)) +10;
      System.out.println(randomNum);
  
  
      Die firstRoll = new Die();
  
      for(int j = 0; j &lt; 5; j++)
      {
  
          System.out.println(playerNames[j] + "'s Turn! ");
  
              firstRoll.roll();
  
              myDie[j][0] = firstRoll;
  
  
      }
  
  
  
  
  
      }
  
  }
  </code></pre>
  
  <p>It highlights the following when i click the error</p>
  
  <pre><code>myDie[j][0] = firstRoll;
  </code></pre>