Why do we create an empty constructor in Java?

8 Answers. An empty constructor is needed to create a new instance via reflection by your persistence framework . If you don’t provide any additional constructors with arguments for the class, you don’t need to provide an empty constructor because you get one per default.

Sizin İçin Seçtik  How do you do we declare constructor and what is use of declaring a constructor?

Leave a Reply

Your email address will not be published. Required fields are marked *