How do you call a parameterized constructor from a default constructor?

Use this(); in the first line of the parametrized constructor and it will call your default constructor. Make sure you have default constructor as compiler will not provide one if you declare a parametrized constructor.

Sizin İçin Seçtik  What is default constructor called Java?

Leave a Reply

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