This code would call all of the parents constructors or methods. Is that correct?
James Clinton
Ranch Hand
Joined: Jun 23, 2003
Posts: 190
posted
0
super() will call the conctructor of you extending class. Also if used it must be the first line in a contructor method. For example:
// PARENT CLASS
// CHILD CLASS
Calling super is only neccessay if you have code in the constructor that needs initialising. Else you can happy invoke its methods (assuming they are visible (public, protected etc)). super.someParentMethod(); Hope that helps. / James
Dirk Schreckmann
Sheriff
Joined: Dec 10, 2001
Posts: 7023
posted
0
This code would call all of the parents constructors or methods. Is that correct? No. super() would only invode the superclass constructor that takes no arguments.