- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Can an anonymous class have constructors in Java?
A constructor should have the name same as the class. Since anonymous inner class has no name, an anonymous inner class cannot have an explicit constructor in Java.
But, Java compiler internally creates a constructor for the anonymous class.
Advertisements
To Continue Learning Please Login
Login with Google