...

View Full Version : Quick Constructor Question



Sayonara
06-07-2007, 04:37 PM
Hi all, just a quickie:

If I have class B extending class A, and both classes contain different constructors, does the creation of an object of class B cause initialisation with B's constructor only, or A's then B's?

In other words, if I want B to be initialised with properties of A, is it enough to simply extend, or do I need a call to the parent's constructor as well?

kbluhm
06-07-2007, 04:45 PM
This may be of some help:
http://www.hudzilla.org/phpbook/read.php/6_10_1

Sayonara
06-07-2007, 05:15 PM
So yes, needs a call to the parent constructor.

Thanks :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum