fixed program 11 and added appropriate output screenshot
This commit is contained in:
@@ -9,5 +9,11 @@ public class ArrayListDemo{
|
||||
System.out.println("Element at index 0: " + arrayList.get(0));
|
||||
System.out.println("Element at index 1: " + arrayList.get(1));
|
||||
System.out.println("Element at index 2: " + arrayList.get(2));
|
||||
System.out.println("Array List Elements: ");
|
||||
for(String element: arrayList){
|
||||
System.out.println(element);
|
||||
}
|
||||
arrayList.remove("Element 2");
|
||||
System.out.println("Size of ArrayList after removal: " + arrayList.size());
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 20 KiB |
Reference in New Issue
Block a user