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  What are class constructors used for?

Leave a Reply

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