Skip to content

Commit cd628d1

Browse files
committed
feat: Create and populate a 2D dynamic ArrayList (3x3) using user input
🧠 Logic: - Initializes a 2D `ArrayList<ArrayList<Integer>>` with 3 inner lists. - Uses nested loops to input 3 elements into each of the 3 inner lists. - Displays the 2D list structure as a single output. 🔍 Demonstrates dynamic 2D list creation where row sizes and content can be varied. Signed-off-by: Somesh diwan <[email protected]>
1 parent 04bd35e commit cd628d1

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

Section9ArrayAB/Array IMP/MultiAL.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ public static void main(String[] args) {
66
Scanner in = new Scanner(System.in);
77
ArrayList<ArrayList<Integer>> list = new ArrayList<>();
88

9-
// initialisation
109
for (int i = 0; i < 3; i++) {
1110
list.add(new ArrayList<>());
1211
}
@@ -17,7 +16,6 @@ public static void main(String[] args) {
1716
list.get(i).add(in.nextInt());
1817
}
1918
}
20-
2119
System.out.println(list);
2220
}
2321
}

0 commit comments

Comments
 (0)