How is the default constructor related to constructor overloading?

  • The default constructor is used when no other constructor is defined.
  • Default constructors cannot be overloaded.
  • Constructor overloading is used to define multiple default constructors.
  • The default constructor is always public.
The default constructor is related to constructor overloading in that it is used when no other constructor is explicitly defined in a class. Constructor overloading refers to the practice of defining multiple constructors in a class with different parameter lists. The default constructor is automatically provided by Java when no constructors are explicitly declared. Option 1 correctly explains this relationship.
Add your answer
Loading...

Leave a comment

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