Actually what is an abstract data type?

Recommended Answers

All 3 Replies

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.

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.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.