What is the output of the following code segment?

What is the output of the following code segment?


Collection<String> coll = List.of("A","B","B","C");
coll.remove("C");


Answer: fail to compile. Cannot add or remove elements in lists or sets.


Learn More :

Data Structures

Learn More Multiple Choice Question :