How will you traverse the Multidimensional Array (100 Dimension or More), you do not have the rows, columns, size of the array, and datatype of Array nothing. code example

Example 1: Multidimensional array in java

// two dimensional array in java example program
public class SimpleTwodimensionalArray
{
   public static void main(String[] args) 
   {
      // declare and initialize two dimensional array
      int[][] arrnumbers = {{2, 4},{6, 8},{10, 12}};   
      System.out.println("Two dimensional array in java: ");    
      for(int a = 0; a < 3; a++) 
      {
         for(int b = 0; b < 2; b++) 
         {
            System.out.println(arrnumbers[a][b]);
         }
      }
   }
}

Example 2: 2d array java

int[][] arr = new int[10][20]; 
        arr[0][0] = 1;

Tags:

Java Example