Does a default constructor call the baseclass constructor?

Does a default constructor call the baseclass constructor?

Search for: Does a default constructor call the baseclass constructor?

In Java Does a default constructor call the baseclass constructor?

Search for: In Java Does a default constructor call the baseclass constructor?

  1. A default constructor is provided if there are no other constructors
  2. if there are constructors then there is no default constructor
  3. Every constructor will call the supers default constructor if there is no explicit call to a super constructor

SomeClass
{
   public SomeClass(someargs)
   {
      super(); //this is implied
      //do something with someargs
   }
   public SomeClass()
   {
      super(); //this is automatic, no need to do this
   }
}

Because the super class default constructor is automatically added, if the base class defines a non default constructor and does not define a default constructor then it will be an error.