Search code examples
javapackageconventions

Is there a java convention for packaging enums?


Is there a Java convention for packaging enums? if not is there a best practice? Should I put them all in one package "myapp.enum" or should I put each enum in its related package?


Solution

  • enums in Java should be treated like any other class, and should probably be placed in the package that's most related to them. There's no advantage in having a separate "enums" package.