Hi, Could you please tell me does constructors get inherited? thanks in advance sridevi
Joined: Aug 08, 2003
They do not
Joined: Aug 13, 2001
Well. This is partly correct. If you do not call the parent class constructor explicitly java automatically calls the 'no argument' constructor of the parent class, if the parent class has one. This is done in the begining of the child constructor. If you want to call the constructor with some argument(s), then it has to be done explicitly, using super(). And should be the first statement in the child constructor. Hope this helps. Kaustubh.