Inherits Statement


Inherits Statement

Syntax

     Inherits className 


className (required)

The name of the inherited (base) class

Description

The Inherits statement specifies the name of the class from which a new class is being derived; it specifies the base class of the current class. The statement appears immediately after the Class statement or the Interface statement.

Usage at a Glance

  • The Inherits statement must be the first line of code in the class or interface. It can be preceded only by blank lines and comments.

  • Visual Basic does not support simultaneous inheritance from multiple classes in a derived class. There can be only a single Inherits statement in a class definition.

  • Interfaces support either single or multiple inheritance from other interfaces. Use a comma used to delimit multiple base interfaces:

         Interface IPerson        Property Name As String     End Interface     Interface IEmployee        Property SSN As String     End Interface     Interface ISalaried        Inherits IPerson, IEmployee        Property Salaried As Boolean        Property Salary As Decimal     End Interface 

See Also

Class Statement, Interface...End Interface Statement




Visual Basic 2005(c) In a Nutshell
Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))
ISBN: 059610152X
EAN: 2147483647
Year: 2004
Pages: 712

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net