spacer
Yehuda Shiran May 31, 2002
Extending Base Classes
Tips: May 2002

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

Inheritance is one of the major advantages of object oriented programming languages. When you have a class that provides most of the functionality you need, you can create a new class that is based on the existing class. The new class extends the functionality of the existing class, usually called the base class. The new class does everything the base class does, and more. Inheritance avoids duplication of code, promotes code reuse, cuts down the number of lines of code, and optimizes the maintenance burden.

The syntax for extending a base class is as follows:

  class NewClass extends BaseClass {
    [classmembers]
  }
where NewClass is the new class, BaseClass is the base class, and classmembers are the additional class members of the new class. They are added to whatever class members are defined in the base class.

To learn more about JScript .NET, go to Column 110, JScript .NET, Part IV: Inheritance.


People who read this tip also read these tips:

Look for similar tips by subject:

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Creating a Banking Application Deposit Script · Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Best Buy to Market Phone Power VoIP Service · Industry Insiders: Ted Morgan, CEO, Skyhook Wireless · Chip Market Recovering From '08 Collapse