Q:

What is an abstract class in c++?

0

What is an abstract class in c++?

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Answer:

An abstract class is a class for which one or more functions are declared but not defined (have one or more functions pure virtual), meaning that the compiler knows these functions are part of the class, but not what code to execute for that function. These are called abstract functions. Here is an example of an abstract class.

class shape
{
public:
    virtual void Calculate() = 0;
};

Note: We can not be instantiated, abstract class.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C++ Interview Questions For Experienced

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Write down some important points related to abstra... >>
<< Can virtual functions be private in C++?...