/
EugenyCh7
/
JavaAndScalaLessons
Обзор
Документация
Войти
/
EugenyCh7
/
JavaAndScalaLessons
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
JavaTest/src/ch4/ex7/Colors.java
34 строки
779 B
Eugeny Chekmarev
IDEA update
15 июн 2021, 21:11
15 июн 2021, 21:11
47fadf9
Код
Авторство
О чём код?
package ch4.ex7; public enum Colors { BLACK((byte) 0, (byte) 0, (byte) 0), RED((byte) 255, (byte) 0, (byte) 0), GREEN((byte) 0, (byte) 255, (byte) 0), BLUE((byte) 0, (byte) 0, (byte) 255), CYAN((byte) 0, (byte) 255, (byte) 255), MAGENTA((byte) 255, (byte) 0, (byte) 255), YELLOW((byte) 255, (byte) 255, (byte) 0), WHITE((byte) 255, (byte) 255, (byte) 255); private final byte red; private final byte green; private final byte blue; Colors(byte red, byte green, byte blue) { this.red = red; this.green = green; this.blue = blue; } public byte getRed() { return red; } public byte getGreen() { return green; } public byte getBlue() { return blue; } }