Originally posted by Eric Gonzalez:
I dont understand.
you talk about the superclass when class cn7 doesn't extends any one.
Are you refering to the implicit inheritence from Object?
Please me tell me if I'm right:
a) this( argument list) call a same class constructor -used to avoid to rewrite code-(not necessary it have to involve inheritence
b) super(arguments list) call the baseclass constructor to initialize the hidden baseclass object passed secretly to the subclass
Eric,
As you guessed the superclass of cn7 is Object. Remember that all classes that do not explicitly extend any other class will extend from Object.
Regarding to your queries in this and super, "this (args)" is used to call constructors of the same class. Note that this is the
only way to call another constructor ("cn7(a)" would be incorrect).
The call super(args) is used to call a constructor of the superclass. As you said, this will initialise it.
Just another note, when the java compiler detects that the class does not explicitly extends another class, it will automatically add an "extends Object".
Hope this helps
Eduard