Here are 10 essential multiple-choice questions on Java Collection Framework, covering key concepts
Question 2
What will be the output of the following code?
import java.util.*;
public class Test {
public static void main(String[] args) {
List<String> list = new ArrayList<>();
list.add("A"); list.add("B"); list.add("C");
Collections.reverse(list);
System.out.println(list);
}
}
Question 8
What will be the output of the following code?
import java.util.*;
public class Test {
public static void main(String[] args) {
List<Integer> list = Arrays.asList(1, 2, 3, 4);
Collections.fill(list, 5);
System.out.println(list);
}
}
There are 10 questions to complete.
Quiz about Java Collection Framework