Exforsys
+ Reply to Thread
Results 1 to 4 of 4

abstract class

This is a discussion on abstract class within the C and C++ forums, part of the Programming Talk category; what is abstract class??...

  1. #1
    Manyamanas is offline Member Array
    Join Date
    Dec 2010
    Answers
    32

    abstract class

    what is abstract class??


  2. #2
    techvinny is offline Moderator Array
    Join Date
    Dec 2010
    Answers
    56
    An abstract class is a class which cannot be instantiated and would have some basic traits that all classes deriving with it shall possess.

    hypothetical e.g., a Person could be deemed as an abstract class and since every person would have a name so name could be declared within the Person class (could be defaulted to unknown ). Any class (Boy), deriving from it would inherit the default name 'unknown' and when its naming ceremony would occur, the setName(...) method on the derived class could be invoked to assign the person (Boy) a name.

    Abstract classes are good to define default behavioral traits that all derived classes would inherit.


  3. #3
    Sandhya.Kishannag is offline Member Array
    Join Date
    Feb 2012
    Answers
    66
    Abstract class is a class that can not be instantiated and it must be inherited. Abstract classes are classes that contain one or more abstract methods (methods without implementation). An abstract method is a method that is declared, but doesn't contain implementation.An abstract class can contain both abstract and non abstract methods in it.if any of its child class wants to consume its non abstract method then it first implements all the abstract method of parent.


  4. #4
    Sandhya.Kishannag is offline Member Array
    Join Date
    Feb 2012
    Answers
    66
    An abstract class is a class that cannot be instantiated and is usually implemented as a class that has one or more pure virtual (abstract) functions.
    A pure virtual function is one which must be overridden by any concrete (i.e., non-abstract) derived class.


    •    Sponsored Ads



Latest Article

Network Security Risk Assessment and Measurement

Read More...