How To Remove Duplicates From List #683
How to remove duplicates from List?
This multiple choice question (MCQ) is related to the book/course gs gs128 Java. It can also be found in gs gs128 Java Util Collections Framework - Java List - Quiz No.1.
How to remove duplicates from List?
HashSet<String> listToSet = new HashSet<String>(duplicateList);
HashSet<String> listToSet = duplicateList.toSet();
HashSet<String> listToSet = Collections.convertToSet(duplicateList);
HashSet<String> listToSet = duplicateList.getSet();