Q:

What is the difference between a concrete class and an abstract class in c++?

0

What is the difference between a concrete class and an abstract class?

All Answers

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

Abstract class:

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;
};

Concrete class:

A concrete class is an ordinary class that has no pure virtual functions and hence can be instantiated.

class message
{
public:
    void Display()
    {
        cout <<"Hello";
    }
};

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

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now