Can an anonymous class implement an interface and also extend a class at the same time?
No. An anonymous class can either extend a class or implement a single interface. If the anonymous class is extending a class then it becomes the implementer of all the interfaces implemented by its superclass automatically.
No comments:
Post a Comment