There is no universally "proper" way of defining enum
s - it goes the same way as other entities that can be nested or could exist on their own, such as classes and interfaces.
- When your
enum
is intended for use only with a particular class, for example, to enumerate options of one of its methods, definingenum
inside the class is reasonable - When your
enum
is intended to be shared among multiple classes, define it at the top level.