I
isamura
...
: On Tue, 25 Oct 2005 10:37:42 +0100, "Chris Uppal"
: quoted someone who said :
:
: >As far as I know there is no good reason why Java constuctors don't inherit.
:
: How about his case?
:
: Dog( int weightInKg );
:
: Dalmatian( int weightInKg, float percentBlack );
:
: In your universe I would be forced to support a constructor
:
: Dalmatian( int weightInKg );
:
: that would force me to allow Dalmatian objects to be created without
: the Dalmatian colour information.
:
That may well be the case however the inherited constructor is still valid for Dalmatian. One can
over-ride the constructor and provide a default percentBlack value or:
dog = new Dalmatian(20);
dog.percentBlack(0.45);
..K
: On Tue, 25 Oct 2005 10:37:42 +0100, "Chris Uppal"
: quoted someone who said :
:
: >As far as I know there is no good reason why Java constuctors don't inherit.
:
: How about his case?
:
: Dog( int weightInKg );
:
: Dalmatian( int weightInKg, float percentBlack );
:
: In your universe I would be forced to support a constructor
:
: Dalmatian( int weightInKg );
:
: that would force me to allow Dalmatian objects to be created without
: the Dalmatian colour information.
:
That may well be the case however the inherited constructor is still valid for Dalmatian. One can
over-ride the constructor and provide a default percentBlack value or:
dog = new Dalmatian(20);
dog.percentBlack(0.45);
..K