1.

How to remove duplicates from List?

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


Discussion

No Comment Found