Roedy Green wrote :
On Mon, 30 Jul 2007 15:30:17 GMT, Wojtek <nowh...@a.com> wrote, quoted
or indirectly quoted someone who said :
I am curious about this statement: "Normally it would be public in its
own *.java file".
I usually place the enum on the class which uses it:
1. I though there was a limit of one public class per *.java file.
2. I like to put one class per *.java file because it makes classes
easier to find.
3. It seems to me, the compiler would have troubles finding the source
for classes if you don't do that, but obviously it somehow does.
But an enum is not really a "full" class. You cannot extend it for
instance.
I also only put one class per file, except where it makes more sense,
such as a private class only used within the enclosing class.
I do use somewhat deeply nested public classes in things like constants
where I organize information:
public class Foo
{
public static final String VALUE = "value";
public static class Bar
{
public static final String VALUE = "barValue";
}
}
which can be accessed as:
Foo.Bar.VALUE
--
Wojtek :-)
external configuration, such as Properties, or a custom XML file. Or,