Vidyalelo
Java Programming · Q114

Java Collections Framework

Programming · Java Programming · question 114

Q114

How to remove duplicates from List?

A.
HashSet<String> listToSet = new HashSet<String>(duplicateList);
Answer
B.
HashSet<String> listToSet = duplicateList.toSet();
C.
HashSet<String> listToSet = Collections.convertToSet(duplicateList);
D.
HashSet<String> listToSet = duplicateList.getSet();

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board