/
anton.buldygin
/
Contacts_Java
Обзор
Документация
Войти
/
anton.buldygin
/
Contacts_Java
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Topics/Enumset/Vaccination/src/Main.java
18 строк
515 B
AntonBuldygin
Initial commit
19 дек 2023, 15:38
19 дек 2023, 15:38
bed9366
Код
Авторство
О чём код?
import java.util.EnumSet; public class Main { public enum Age { AGE_0_TO_10, AGE_11_TO_17, AGE_18_TO_45, AGE_46_TO_60, AGE_60_ABOVE } public static void main(String[] args) { EnumSet<Age> notAllowedAgeGroup = EnumSet.of(Age.AGE_0_TO_10, Age.AGE_11_TO_17); // create an allowedAgeGroup enumSet and print it using standard printing functions EnumSet<Age> allowedAgeGroup = EnumSet.complementOf(notAllowedAgeGroup); System.out.println(allowedAgeGroup); } }