Question: What value will be printed after running the following code: 1 . ArrayList lst = new ArrayList ( ) ; 2 . for ( int

What value will be printed after running the following code:
1. ArrayList lst = new ArrayList();
2. for (int i =0; i <4; ++i){
3. lst.add(i +1);
4.}
5. lst.add(3);
6. lst.add(4);
7. lst.remove(3);
8. System.out.println(lst +""+ lst.size());
Group of answer choices
[1,2,3,3,4]5
[1,2,3,4,3,4]6
[4,1,2,3,4]5
[1,2,4,4]4

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!