Exforsys
Results 1 to 3 of 3

Struck Abstract with Abstract Class

This is a discussion on Struck Abstract with Abstract Class within the C and C++ forums, part of the Programming Talk category; Hi, I think we cannot define objects for an abstract class.If my thinking is correct my mind poses the question ...

  1. #1
    priyaraji is offline Member Array
    Join Date
    Apr 2006
    Answers
    52

    Struck Abstract with Abstract Class

    Hi,
    I think we cannot define objects for an abstract class.If my thinking is correct my mind poses the question what is the need of having Abstract classes.Can someone help me out??

    Sripriya

  2. #2
    Ralph is offline Senior Member Array
    Join Date
    Apr 2006
    Answers
    114
    Yes you are right. Abstract types can never be created. Unlike concrete classes, they merely specify an interface to an object, not an object itself. All you can do with an abstract type is to declare a variable to be of that type. Such a variable can point to any actual object which is a subtype of that abstract class. So abstract classes, do not define objects.

  3. #3
    rachelle is offline Member Array
    Join Date
    Apr 2006
    Answers
    97
    From the reason for abstract classes not defining objects provided itself, the need for abstract classes is visible. The body of an abstract class definition consists of a semicolon separated list of signatures. Each specifies the signature of a method without providing an implementation at that point. The argument names are required for documentation purposes only and are ignored.

    •    Sponsored Ads