Question: solve it 2. list1 is an arraylist which stores String information. What will be the output of the following code segment? list1.add(Anaya); listi.add(Layla); list1.add(Sharrie); listl.set(0,
2. list1 is an arraylist which stores String information. What will be the output of the following code segment? list1.add("Anaya"); listi.add("Layla"); list1.add("Sharrie"); listl.set(0, "Destini"); listi.add(0, "Sarah"); System.out.println(listi); a) ["Sarah", "Destini", "Layla", "Sharrie") b) ["Sarah", "Destini", "Anaya", "Layla", "Sharrie"] c) O ("Destini", "Layla", "Sharrie", "Sarah") d). ["Sarah", "Layla", "Sharrie") Leave blank
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
