Answer the question
In order to leave comments, you need to log in
Is it possible to create an anonymous class if the class does not have a default constructor?
Is it possible to create an anonymous class if the class does not have a default constructor?
The answer is yes, since the anonymous class does not use a constructor, so the class does not have a name. Correctly?
Answer the question
In order to leave comments, you need to log in
All classes always have a constructor. If you don't explicitly define it, the compiler will do it for you. Including for anonymous classes.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question