4
Contributors
3
Replies
5
Views
5 Years
Discussion Span
Last Post by firstPerson
0

An abstract class is a concept, not a real thing. It's a verhicle or art, or beauty. The technical definition you should look up, 'cause this sounds like a homework question.

0

Abstract: exists only in concept, not in reality. In C++ this would be a class with virtual member functions that have no implementation. Exampe:

class abstract {
public:
    abstract();
    abstract(const abstract& cpy);
    ~abstract();
    abstract& operator=(const abstract& rhs);

    virtual unsigned computeArea() = 0;
};

Note the virtual method declaration that has an implementation = 0. That means that it is not implemented in this class, so this class cannot be instantiated. A derived class will have to be created that does implement this method. This is somewhat (not exactly) analogous to a Java interfact class; however, in C++ you can have abstract/virtual classes like this that do implement some of their interfaces, which you cannot with a Java interface class.

0

You can think an Abstract class as a class that combines the similarity of many things into one object. Thus when inheriting from the ABC, you will have to type less redundent code.

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.