Can we have a class with no constructor in it in Java?

It is possible for a class to have no constructor . (An important distinction to draw here is that the JVM does not require all class files to have a constructor; however, any class defined in Java does have a default constructor if a constructor is not explicitly declared.

Sizin İçin Seçtik  Why do we need a no args constructor?

Leave a Reply

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