Hans Wichman wrote:
Hi,

when the superclass has a default contructor without parameters, there is no
need to call it explicitly.
I'd like to turn it around though, no matter what or how you have defined
them, always call them explicitly for clarity's sake and self documentation.
So if the superclass constructor DOES have parameters, I can't call "new SubClass(parameters)" without explicitly calling the superclass constructor in the subclass constructor. i.e. this works:

// in superclass definition
public function SuperClass()   { blah; }
// in code
var foo:SuperClass = new SubClass();

but not this:

// in superclass definition
public function SuperClass(parameter:Type)   { blah; }
// in code
var foo:SuperClass = new SubClass(parameter);

That sounds like a language quirk rather than the nature of inheritance, but I can live with it now that I've identified it. Thanks!

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to