InterviewSolution
| 1. |
What Are Abstract Classes? What Are The Distinct Characteristics Of An Abstract Class? |
|
Answer» An abstract class is a class that cannot be instantiated and is always used as a BASE class. We cannot instantiate an abstract class directly. This implies that we cannot create an object of the abstract class; it must be inherited. We can have abstract as well as non-abstract members in an abstract class. We must declare at least one abstract method in the abstract class. An abstract class is always PUBLIC. An abstract class is declared using the abstract keyword. The basic purpose of an abstract class is to provide a common definition of the base class that MULTIPLE DERIVED classes can share. An abstract class is a class that cannot be instantiated and is always used as a base class. We cannot instantiate an abstract class directly. This implies that we cannot create an object of the abstract class; it must be inherited. We can have abstract as well as non-abstract members in an abstract class. We must declare at least one abstract method in the abstract class. An abstract class is always public. An abstract class is declared using the abstract keyword. The basic purpose of an abstract class is to provide a common definition of the base class that multiple derived classes can share. |
|