What will be the output of the following code?
import java.util.*; public class Test { public static void main(String[] args) { ArrayList<String> list = new ArrayList<>(); list.add("Apple"); list.add("Banana"); list.add("Cherry"); list.add("Date"); list.remove("Banana"); System.out.println(list); } }
[Apple, Cherry, Date]
[Apple, Banana, Cherry, Date]
[Banana, Apple, Cherry, Date]
[Apple, Cherry, Date, Banana]
This question is part of this quiz :
Java ArrayList