Example of Multidimensional java array

Java Programming Language Array in java (Article) Array in java (Program)

1031

Program:

class Arrayxample{
public static void main(String args[]){

//declaring and initializing 2D array
int arr[][]={{1,2,3},{2,4,5},{4,4,5}};

 //printing 2D array
 for(int i=0;i<3;i++){
   for(int j=0;j<3;j++){
     System.out.print(arr[i][j]+" ");
  }
  System.out.print("\n");
 }

 }
}

Output:

1 2 3
2 4 5
4 4 5
Press any key to continue . . .

Explanation:

None

This Particular section is dedicated to Programs only. If you want learn more about Java Programming Language. Then you can visit below links to get more depth on this subject.