Wendy Gibbons wrote:Ok so the default constructor is the one without any parameters. You don't HAVE to code one it just keeps calling the super constructor till it finds one. It will find one at Object.
You can make a default constructor if you need to do stuff at class instansiation time, or you can make ones with parameters.
If you don't include a call to a super constructor in YOUR constructor an implict one to the default super constructor happens.
f you create a constructor with parameters. no default constructor exists.
I think the JVM sets the default values on instance variables, as the constructor on Object knows nothing about your variables.
No. The default constructor is the one the compiler adds automatically if you don't include a constructor in your code.
If you explicitly put a constructor in your code that takes no arguments, then that is a no argument constructor.
A subtle but important difference.