Ramu
Ramu

Reputation: 97

Enum inside other enum

Public enum BASECOLORS {
   GREEN,
   RED
}

public enum ALLCOLORS {
   VOILET,
   ORANGE
}

in the above code how can I access ALLCOLORS.GREEN? ALLCOLORS should have direct access to the BASECOLORS..

Please help me with your suggestions...

Upvotes: 1

Views: 563

Answers (1)

FreeAsInBeer
FreeAsInBeer

Reputation: 12979

This is not possible. Enums are primitives and cannot inherit from other enums, as inheritance is a property of objects.

Upvotes: 1

Related Questions