JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Immediate Solutions: Inheriting from a Base Class

To inherit from a base class in a derived class, you use the Inherits statement, which makes the derived class inherit the attributes, fields, properties, methods, and events from the base class:

Inherits classname

Here, classname is required, and it's the name of a class being inherited by the class in which the Inherits statement is used. You use this statement first thing (before any other statement) in a derived class:

Public Class Form1
    Inherits System.Windows.Forms.Form

As discussed in the In Depth section of this chapter, you can use access modifiers to indicate how the members of a base class will be inherited and what scope they will have. For more information, see the discussion at the beginning of the In Depth section of this chapter.

Related solution:

Found on page:

Creating Classes


Previous Section Next Section

JavaScript Editor Free JavaScript Editor     JavaScript Editor