title: How to insert a value in 2D array in java
body: <p>How can I fill a 3x3 matrix using a 2D array such that the user picks what
  position of the array they want to input their String value? </p>
  
  <p>The position format is: <code>(Row Number, Column Number)</code></p>
  
  <p>For example:</p>
  
  <pre><code>Person 1, please pick where to place an X: (0,1)
  Person 2, please pick where to place an O: (0,2)
  </code></pre>
  
  <p>This is what I have:</p>
  
  <pre><code>import java.util.Scanner;
  
  public class idk {
      public static void main(String[] args)
  
      {
          int i;
          int j;
          int arr[][] = new int[3][3];
  
          // Getting user input
          Scanner input = new Scanner(System.in);
          System.out.println("Enter a number: ");
          for (i = 0; i &lt; 3; i++) {
              for (j = 0; j &lt; 3; j++) {
                  arr[i][j] = input.nextInt();
               }
  
          }
  
          // Outputting the user input
          System.out.println("The output is: ");
          for (i = 0; i &lt; 3; i++) {
              for (j = 0; j &lt; 3; j++) {
                  System.out.printf("%d ", arr[i][j]);
              }
          }
      }    
  }
  </code></pre>