Computer Science, asked by ahmedqadeerahme144, 9 months ago

The class in c++ which act only as a base class and object of it cannot be created is

Answers

Answered by rajwantkaur123
0

Answer:

abstract class

Explanation:

Abstract classes (C++ only):-- An abstract class is a class that is designed to be specifically used as a base class. An abstract class contains at least one pure virtual function. ... A class derived from an abstract base class will also be abstract unless you override each pure virtual function in the derived class.

Answered by KailashHarjo
0

The class in C++ which act only as a base class and object of it cannot be created is Abstract class.

  • A class that is specifically intended to be used as a base class is known as an abstract class. There is at least one pure virtual function in an abstract class.
  • In the declaration of a virtual member function in the class declaration, you declare a pure virtual function by using the pure specifier (= 0).
  • Functions with virtual members can be inherited. Unless you override each pure virtual function in the derived class, an abstract base class will also be an abstract class.
  • A class that is abstract serves as a suitable base class from which other classes can inherit.
  • Abstract classes only act as interfaces and cannot be used to create new objects. A compilation error results from attempting to instantiate an object of an abstract class.

For more information on abstract classes in C++, refer to these answers:

https://brainly.in/question/1791885

https://brainly.in/question/14586057

#SPJ3

Similar questions