Every subclass constructor must contain a call to a superclass constructor. If you don't put one in yourself, the compiler inserts
super();
This results in a compiler error if the superclass doesn't
have a no-argument constructor. In this case, you have to call one of the existing constructors yourself; i.e.,
super(0);
Remember that if you don't define any constructors in a class, the
Java compiler inserts one like this:
And so again, this won't compile if the superclass doesn't have a default constructor.
Finally, note that if a class
does have one or more constructors defined, the compiler will
not add a no-argument constructor.