I wondering if someone could explain this concept to me. "A no-argument Constructor is not necessarily the default Constructor, although the default Constructor is always a no-argument Constructor". This completely confused me, I hope someone can explain this in layman terms.
A no-arg constructor is a constructor that takes no arguments. A default constructor is a constructor that the java compiler creates for you when you don't define any constructors in your class definition.
If you define a constructor in your class, then no default constructor will be created for you. And if your constructor takes no arguments, then your constructor (which is not a default constructor) is a no-arg constructor.
Try this:You think those two classes do the same thing, and you would be right. And if you compile them, and then inspect the bytecode, like this:... you will see the no-args constructor, with and without its contents. I think it will say something like <init> against it.
Now repeat the procedure with the Baa class. You can see that the compiler has added a constructor, which is a default constructor, doing the absolute minimum possible for a constructor, ie calling the superclass' constructor.
The Java™ Language specification tells you about default constructors, but it isn't easy to read.