Answers for "get unique elements from java list"

1

java get distinct values from list

List<String> distinctElements = list.stream()
                        .distinct()
                        .collect(Collectors.toList());
Posted by: Guest on January-17-2021
1

java get unique elements from array

String[] unique = Arrays.stream(array).distinct().toArray(String[]::new);
Posted by: Guest on February-20-2021

Code answers related to "get unique elements from java list"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language