Answer to Question #294980 in Java | JSP | JSF for Pankaj

Question #294980

 Write a proper program to perform any operation on jagged array{java}


1
Expert's answer
2022-02-08T01:16:12-0500
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();
        }
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS