Question: What would be the output of the following cod ArrayList list = new ArrayList (); list.add(10); list.add(5); list.add(12); list.set(1, 30); for(int i=0; i <
What would be the output of the following cod ArrayList list = new ArrayList (); list.add(10); list.add(5); list.add(12); list.set(1, 30); for(int i=0; i < list.size(); i++) System.out.print(list.get(i) + " "); System.out.println(list.remove(2));
Step by Step Solution
There are 3 Steps involved in it
Answer There are some syntax errors in the provided code Lets correct them and then ... View full answer
Get step-by-step solutions from verified subject matter experts
