What is no constructor in Java?

Java doesn’t require a constructor when we create a class. … The compiler automatically provides a public no-argument constructor for any class without constructors. This is called the default constructor . If we do explicitly declare a constructor of any form, then this automatic insertion by the compiler won’t occur.

Sizin İçin Seçtik  How does the constructor work?

Leave a Reply

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