Can an anonymous class implement an interface and also extend a class at the same time?
Question
Can an anonymous class implement an interface and also extend a class at the same time?
Answer
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.
š² Practice Offline on Mobile: Download the free QA Automation & SDET Prep app on Google Play & App Store.