Abstract Classes
● An abstract class is a class that is declared
abstract.
● It may or may not include abstract methods.
● Abstract classes cannot be instantiated, but
they can be subclassed.
Syntax:
abstract class <class-name>{}
Types of abstraction
● Data abstraction
Abstracting the data members in the abstract
class
● Control abstraction
Abstracting the functions that performs the
operation.
Sample code for abstract classes
Sample output

Abstract classes

  • 1.
    Abstract Classes ● Anabstract class is a class that is declared abstract. ● It may or may not include abstract methods. ● Abstract classes cannot be instantiated, but they can be subclassed. Syntax: abstract class <class-name>{}
  • 2.
    Types of abstraction ●Data abstraction Abstracting the data members in the abstract class ● Control abstraction Abstracting the functions that performs the operation.
  • 3.
    Sample code forabstract classes
  • 4.