Difference between a no-arg constructor and a default constructor in Java

The default constructor is a constructor that the Java compiler adds to your code if no explicit constructor is available. The default constructor invokes the super class constructor with no args.

If you have added your own constructor (no matter whether it's without parameters or with parameters) the compiler will not add the default constructor in this case.


The default constructor is a no-args constructor that the Java compiler inserts on your behalf; it contains a default call to super(); (not supper()) which is the default behavior. If you implement any constructor then you no longer receive a default constructor.

JLS-8.8.9. Default Constructor says (in part),

If a class contains no constructor declarations, then a default constructor with no formal parameters and no throws clause is implicitly declared.

If the class being declared is the primordial class Object, then the default constructor has an empty body. Otherwise, the default constructor simply invokes the superclass constructor with no arguments.