what is the purpose of an abstract class?

An abstract class is defined abstract or it becomes abstract if one of the member function is not defined (depends on the language). An abstract class cannot be instasiated to create objects.. An abstract class is designed only to act as a base class (to be inherited by other classes). It is a design concept in program development and provides a base upon which other classes may be built.

Let me say that you are working in a company that has to develop a big software project.. Thee are hundreds of modules and each programmer is assigned a module.. There needs to be a standard way of doing it so that all the modules can be integrated later...

So what the project leader does is create an abstract class.. so it contains all the modules (functions) prototype i.e. the parameters it take , the value it returns, the function nae etc.. so what you do is, you inherit this abstract class in your class and define the function.. So there is a standard maintained.. You dont define the name of the function, parameters it takes to your wims and fancies...

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.