Question: JAVA OOP BY USING NETBEANS Q. No. 2 Develop a complete Java application. In the main method of the application, create a jagged 2D array
JAVA OOP BY USING NETBEANS
Q. No. 2 Develop a complete Java application. In the main method of the application, create a jagged 2D array of type int having six rows (ie, an array having six arrays). The number of elements in a particular row must be equal to the corresponding digit of your own roll number. For example, if somebody's roll number is 141257, then the resultant array would look like: 6 7 8 9 10 14 | 15 11 12 13 16 | 17 | 18 19 20 Next, you must use nested loops to initialize the elements of the 2D array with the value of a counter that is incremented by 1 during each iteration of the inner loop, as shown in the above example. Finally, use nested loops to display the values of all the elements stored in the array. Each row must be printed in a separate line. For example, following would be the output for the above array 1 2345 6 78 9 10 11 12 13 14 15 16 17 18 19 20
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
