What is the default constructor in Java?

  • A constructor provided by Java for every class
  • A constructor with a single parameter
  • A constructor with default values
  • A constructor with no parameters
In Java, the default constructor is a constructor provided by Java for every class that doesn't explicitly define its own constructor. It takes no parameters and initializes instance variables to their default values. The other options do not accurately describe the default constructor in Java.
Add your answer
Loading...

Leave a comment

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