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();
How to remove duplicates from List?
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
How to remove duplicates from List?
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!