home / experts / javascript / column111 |
|
The Object TypeWhen a new class inherits from a base class, it gets all the base's members. You cannot get rid of these members. You can do one of the three: accept, hide, or override them. The default is to accept them. You accept them by refraining from their redefinition in the derived class. Simply put, do not define a derived class's member with the same name as a base class's member. When you do redefine a base member, you override the base class's member by default; this is how you override a base class. You can reflect the override by adding Every class inherits from a base class. This statement is true because all classes are implicitly derived from the
is identical to this alternate definition:
The
And these are the methods:
So, every class supports these 8 members by default. You don't have to do anything specific to inherit them. When defining a new class, you can accept these members, |
Next: How to use derived objects with base methods
Produced by Yehuda Shiran and Tomer Shiran
All Rights Reserved. Legal Notices.
Created: June 3, 2002
Revised: June 3, 2002
URL: http://www.webreference.com/js/column111/2.html