Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

get distinct values from list of objects java

public Set<String> areas(final List<Employee> employees) {
    Set<String> areas = new HashSet<>();
    for(final Employee employee: employees) {
        areas.add(employee.getArea());
    }
    return areas;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #distinct #values #list #objects #java
ADD COMMENT
Topic
Name
6+1 =