Guest User

Untitled

a guest
May 22nd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.53 KB | None | 0 0
  1. class apples {
  2.     public static void main(String[] args) {
  3.         int array_one[][] = {{8,9,10,11},{12,13,14,15}};
  4.         int array_two[][] = {{30,31,32,33},{43},{4,5,6}};
  5.        
  6.         System.out.println("This is the first array");
  7.         display(array_one);
  8.        
  9.         System.out.println("This is the second array");
  10.         display(array_two);
  11.        
  12.     }
  13.     public static void display(int x[][]){
  14.         for(int row = 0; row < x.length; row++){
  15.             for(int col = 0; col < x[row].length; col++){
  16.                 System.out.print(x[row][col]+"\t");
  17.             }
  18.             System.out.println();
  19.         }
  20.     }
  21. }
Add Comment
Please, Sign In to add comment