posted 23 years ago
You can use an anonymous class inside a constructor, which is not a method. Or how about this example:
There's two examples that prove B is false.
An inner class is a class defined inside the instance of another class. An anonymous class just means you are creating an instance of a subclass of a class without giving the subclass a name. So they are two different things. That being said, you can't define a top-level anonymous class; the only place you can define an anonymous class is within something else. So in practice, your anonymous class is always going to be a nested class.