If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re: Overriding the constructor

Well, then the answer should be fairly obvious: when your derived class objects need to be initialised in a way not anticipated by the base class. I'm sure you have come across such cases in other programming languages that also have native OO support.

As for the how: do you know how to write a constructor? Do you know how to use super to invoke a base class method? If not, learn how. If you do, then you have your answer.

Advertiser Disclosure:
Some of the products that appear on this site are from companies from which QuinStreet receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. QuinStreet does not include all companies or all types of products available in the marketplace.