Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.expgamer303.javabasics.arrayStuff;
- public class TableForMultidimensionalArray {
- public static void main(String args[]) {
- int myArray[][] = {{1, 2, 3, 4, 5},{6, 7, 8, 9, 10}};
- int myArray2[][] = {{30, 31, 32, 33},{43},{4, 5, 6}};
- System.out.println("This is the First Array");
- display(myArray);
- System.out.println("This is the Second Array");
- display(myArray2);
- }
- public static void display(int x[][]) {
- for (int row = 0; row < x.length; row++) {
- for (int column = 0; column < x[row].length; column++) {
- System.out.print(x[row][column] + "\t");
- }
- System.out.println(x);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement