O
Oliver Wong
You can define a class inside a block of java code as in:
class Example {
public void someMethod() {
class LocalClass {
public void itsOwnMethods() {
}
}
LocalClass instance = new LocalClass();
instance.itsOwnMethods();
}
}
but I can't seem to find a way to define an enum inside a block of java
code. What's the syntax for doing this, or is it impossible? And if it's
impossible, can anyone think of a good reason why it's impossible?
- Oliver
class Example {
public void someMethod() {
class LocalClass {
public void itsOwnMethods() {
}
}
LocalClass instance = new LocalClass();
instance.itsOwnMethods();
}
}
but I can't seem to find a way to define an enum inside a block of java
code. What's the syntax for doing this, or is it impossible? And if it's
impossible, can anyone think of a good reason why it's impossible?
- Oliver