Код: Выделить всё
public class AClass {
private enum MyEnum{
A { public String method1(){ return null; } },
B { public Object method2(String s){ return null; } },
C { public void method3(){ return null; } } ;
}
...
}
Кроме того, как его следует использовать? Потому что следующее не компилируется:
Код: Выделить всё
private void myMethod () {
MyEnum.A.method1();
}
Подробнее здесь: https://stackoverflow.com/questions/655 ... -instances
Мобильная версия