c#에선 enum값이 원시 데이터 타입이라 필드나 메소드 못만든다던데


자바에선


enum Fruits { 

APPLE(true),

BANANA(false),

GRAPE(false),

ORANGE(false), 

STRAWBERRY(true);


bool isRed;

Fruits(bool isRed) {

this.isRed = isRed;

}

bool isRed() {

return isRed;

}

}


이런식으로 enum에서 자체적으로 값을 지정해줄 수 있잖음


c#에선 이렇게 깔끔하게 못함?


밖에서 따로 enum 값별로 분류해주는 메소드를 만들어야함?