Write a proper program to perform any operation on jagged array{java}
public class Main {
public static void main(String[] args) {
int[][] jaggedArray = {{1, 2, 3}, {1, 2, 3, 4, 5, 6}, {1, 2}, {1, 2, 3, 4}};
for (int i = 0; i < jaggedArray.length; i++) {
for (int j = 0; j < jaggedArray[i].length; j++) {
System.out.print(jaggedArray[i][j]+" ");
}
System.out.println();
}
}
}
Comments
Leave a comment