Explain abstract classes, C/C++ Programming

Abstract Classes

Abstract classes are the classes, which are written just to act as base classes. Consider the following classes.

                class base

                 {

                                :

                                :

                 };

 

class  Aclass : public base

                 {

                                :

                                :

                 };

 

                class  Bclass : public base

                 {

                                :

                                :

                 };

                class  Cclass : public base

                 {

                                :

                                :

                 };

                void main()

                 {

                   Aclass objA;

                   Bclass objB;

                   Cclass objC;

 

                                :

                                :

                }

There are three classes - Aclass, Bclass, Cclass - each of which is derived from the class base. The main () function declares three objects of each of these three classes. Though, it does not declare any object of the class base. This class is a general class whose sole purpose is to serve as a base class for the other three. Classes used only for the purpose of deriving other classes from them are known as abstract classes. They simply serve as base class, and no objects for such classes are created

 

Posted Date: 6/28/2013 5:51:10 AM | Location : United States







Related Discussions:- Explain abstract classes, Assignment Help, Ask Question on Explain abstract classes, Get Answer, Expert's Help, Explain abstract classes Discussions

Write discussion on Explain abstract classes
Your posts are moderated
Related Questions
i have a project that is due this Wednesday and i was wondering if i can get help in doing it?

- Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles. The user should be able to view all DVD titles in his library, add and d

write a program to find the minimum number of shelves

Padovan String Problem Description A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2 where + denotes s

C Program for EVEN & ODD NO IN ANY MATRICES #include stdio.h> #include conio.h> void main() {           int a[100][100];           int i=0,j=0,r,c,even=0,odd=0;

How would I make a maze in C++? I would prefer to use the recursion maze generation algorithm if possible, thanks!

Raj is a newbie to the programming and while learning the programming language he came to know the following rules: · Each program must start with ''{'' and end with ''}''. Ã

c | c-c-c-c-c | c-c-C-c-c | c find distance between difftent carbon atom by programing

How would you print the values of the variables words and lines so they appear in the form: There were 6040 words and 680 lines. Here, 6040 and 680 represent the values of the two