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  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 *

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  Is Flutter web any good?

Leave a Reply

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