title: Having trouble with multidimensional array initialization
body: <p>I'm trying to learn java and of course I'm a beginner. I am facing problem with initializing a multidimensional array. Here is the code I'm trying to write...</p>
  
  <pre><code>import java.util.Scanner;
  public class one {
  
      public static void main(String args[]) {
          int p[][] = null;
          System.out.println("Type ur array here:");
          System.out.println("how many rows and column:");
          int row, colmn;
          Scanner u = new Scanner(System.in);
          Scanner y = new Scanner(System.in);
          Scanner t = new Scanner(System.in);
          Scanner r = new Scanner(System.in);
  
          row = t.nextInt();
          colmn = r.nextInt();
  
          for(int i = 0; i &lt;= row; i++)
              for(int v = 0; v &lt;= colmn; v++){
                  int j = u.nextInt();
                  p[row][colmn] = j;
              }
  
          int a[][] = p;
          System.out.println("The given array:");
          y(a);
  
      }
      public static void y(int n[][]) {
  
          for(int i=0;i&lt;n.length;i++) {
              for(int j=0;j&lt;n[i].length;j++){
                  System.out.print(n[i][j]);
              }
              System.out.println();
          }
      }
  
  }
  </code></pre>
  
  <p>Please someone correct this and provide me with sufficient knowledge I need.</p>