Where is default constructor in Java?

The default constructor in Java initializes the data members of the class to their default values such as 0 for int, 0.0 for double etc. This constructor is implemented by default by the Java compiler if there is no explicit constructor implemented by the user for the class.

Sizin İçin Seçtik  Does Java provide default copy constructor?

Leave a Reply

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