Enthuware explanation for answer to question:
When you create an anonymous class for an interface then it extends from Object. For example,
So the anonymous inner class is instance of ActionListener() which is an interface, hence the anonymous inner class directly extends from Object.
But if you make an anonymous class from another class then it extends from that class. For example, consider the following class:
Here the anonymous class actually extends from MyListener class and successfully overrides the actionPerformed() method.
So anytime an anonymous inner class is made from another class (not an interface) then it directly extends that class.
Is my understanding correct?