📜  从对象列表中获取不同的值java代码示例

📅  最后修改于: 2022-03-11 14:52:09.562000             🧑  作者: Mango

代码示例2
public Set areas(final List employees) {
    Set areas = new HashSet<>();
    for(final Employee employee: employees) {
        areas.add(employee.getArea());
    }
    return areas;
}