Polymorphism

Discussion in 'C++' started by gusaniinfotech, Sep 15, 2014.

  1. gusaniinfotech

    gusaniinfotech New Member

    Joined:
    Sep 9, 2014
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Home Page:
    http://www.gusani.com/
    Please make me clear about "What is Polymorphism in C++?" with simple words...and terms...!! please..!!
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
  3. alia123

    alia123 New Member

    Joined:
    Jan 8, 2016
    Messages:
    65
    Likes Received:
    5
    Trophy Points:
    0
    Janette likes this.
  4. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,009
    Likes Received:
    203
    Trophy Points:
    63
    Occupation:
    Senior Support Engineer
    Location:
    England
    OP: do you understand or do you need further clarification?
     
  5. Claire_Anderson

    Claire_Anderson Member

    Joined:
    Aug 9, 2016
    Messages:
    41
    Likes Received:
    6
    Trophy Points:
    8
    Gender:
    Male
    Location:
    UK
    Home Page:
    http://www.hire-php-developers.co.uk/
    Polymorphism is a Greek work, it means having multiple forms. Polymorphism is an pattern in Object Oriented Programming in which we the classes share same interface with different functionality.

    A real world example for polymorphic is a button. Everyone knows how to use a button: you simply apply pressure to it. What a button does depends on the context it is used and what it is connected to. When some one tells you to press the button You already have all the information needed to perform the task.
     
    Janette likes this.
  6. persysweb

    persysweb Member

    Joined:
    Aug 1, 2017
    Messages:
    98
    Likes Received:
    18
    Trophy Points:
    8
    Location:
    India
    Home Page:
    httpS://persys.in/
    The word polymorphism means having many forms.In simple words,polymorphism is the ability of a message to be displayed in more than one form.
    Real life example of polymorphism, a person at a same time can have different characteristic.
    Like a man at a same time is a father, a husband, a employee. So a same person posses have different behavior in different situations. This is called polymorphism.
     
  7. sayalipatil

    sayalipatil New Member

    Joined:
    Dec 18, 2018
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Gender:
    Female
    Home Page:
    https://crbtech.in/online-java-training-course
    The word polymorphism means having many forms. Typically, polymorphism occurs when there is a hierarchy of classes and they are related by inheritance. C++ polymorphism means that a call to a member function will cause a different function to be executed depending on the type of object that invokes the function.
     
  8. MasterAvalons

    MasterAvalons New Member

    Joined:
    May 14, 2012
    Messages:
    22
    Likes Received:
    5
    Trophy Points:
    3
    This is one of the best explanations I've seen. I think the novice is hard to understand why polymorphism is needed.
    I think almost all the principles of OOP are aimed at creating a concise code, reusing the code, etc.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice