title: create a two dimensional (2D) array in java
body: <p>I am working on a java code that calculates the average of an array and it is working perfectly in serving its purpose but I want to modify it to be a 2D array (Two-dimensional).</p>
  <pre><code>import java.util.*;
  public class Test3{
     public static void main(String [] args){
        Scanner adnan = new Scanner(System.in);
        System.out.println(&quot;Enter the length of the array : &quot;);
        int length = adnan.nextInt();
        int [] input = new int [length];
        System.out.println(&quot;Enter Numbers : &quot;);
        for ( int i = 0; i &lt; length; i++){
           input [i] = adnan.nextInt();
        }
        float average = average(input);
        System.out.println(&quot;Average of all numbers in the array : &quot; + average);
        adnan.close();
     }
     public static float average(int [] input){
        float sum = 0f;
        for ( int number : input){
           sum = sum + number;
        }
        return sum / input.length;
     }
  }
  </code></pre>
  <p>any help would be really appreciated because I am not too good at 2D arrays.</p>