Why do we need no-arg constructor?

The arguments of a constructor can only be found by type, not by name, so there is no way for the framework to reliably match properties to constructor args . Therefore, they require a no-arg constructor to create the object, then can use the setter methods to initialise the data.

Sizin İçin Seçtik  What is constructor in OOP Java?

Leave a Reply

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

Why do we need no arg constructor?

The arguments of a constructor can only be found by type, not by name, so there is no way for the framework to reliably match properties to constructor args . Therefore, they require a no-arg constructor to create the object, then can use the setter methods to initialise the data.

Sizin İçin Seçtik  What goes in a constructor Java?

Leave a Reply

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