Skip to main content

Abstract (Class Keyword)

Specifies whether this is an abstract class.

Usage

To mark a class as abstract, use the following syntax:

Class MyApp.MyClass [ Abstract ]  
{ //class members }

Otherwise, omit this keyword or place the word Not immediately before the keyword.

Details

If an object class is Abstract, you cannot create instances of it.

An Abstract class is meant to be the superclass for one or more concrete (non-abstract) classes. An application could contain an abstract Person class, containing attributes, methods, and properties common to all Persons. The non-abstract Employee and Customer classes could inherit from Person, and contain additional methods and properties specific to each.

An Abstract class can also contain abstract methods with a signature only and no code. The subclasses inherit those methods. A developer must then provide code for the method specific to the subclass.

Effect on Subclasses

This keyword is not inherited.

Default

If you omit this keyword, the class is not abstract.

See Also

FeedbackOpens in a new tab