2
Contributors
1
Reply
10
Views
4 Years
Discussion Span
Last Post by deceptikon
0

An abstract class is meant to be used exclusively as a base class. In other words, it cannot be instantiated directly, but classes that derive from it (if not also abstract classes) can be instantiated. An abstract method is the same thing at the method level: there's no method body, and it's intended to be implemented in a derived class.

In C++ an abstract method is created with the pure virtual syntax, and an abstract class is defined as any class that has one or more pure virtual member functions:

class Abstract
{
    void foo() = 0; // An abstract method makes the class abstract
};

The above might also be called an interface because it only defines abstract methods.

p.s. I'm answering this in good faith, despite your previous posts following a pattern of signature spammers. That is, posting topical but largely fluff questions and answers, then applying a spammy signature to one's account after accumulating a number of such posts. Note that I'll be keeping an eye on you. ;)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.