AceTheInterview
Jobs in Pune | Work better in teams | Socialize with friends | Submit Q&A | Tell a friend
Search site for 

Top 100 Interview Questions & Answers in a convenient and easy to read book!

“I bought this guide a few days ago to prepare for my interview with Oracle. Many of the questions they asked me were from this guide. I found this book absolutely great!”

– Ravi, California

Read more comments...

Interview Questions And Answers RSS Feed

Answers »

  1. Submitted By: Sachin — October 6, 2006
    +5 votes
      + -

    ‘Polymorphism’ is an object oriented term. Polymorphism may be defined as the ability of related objects to respond to the same message with different, but appropriate actions. In other words, polymorphism means taking more than one form.
    Polymorphism leads to two important aspects in Object Oriented terminology - Function Overloading and Function Overriding.
    Overloading is the practice of supplying more than one definition for a given function name in the same scope. The compiler is left to pick the appropriate version of the function or operator based on the arguments with which it is called.
    Overriding refers to the modifications made in the sub class to the inherited methods from the base class to change their behaviour.

  2. Submitted By: Johnny Smartass — October 6, 2006
    -3 votes
      + -

    I thought Polymorphism is what happened to the “Teenage Mutant Ninja Turtles” when they can in contact with that ooze. Really!

    It’s availible at your nearest video store.

  3. Submitted By: johny_bravo — October 6, 2006
    +4 votes
      + -

    Polymorphism can be achieved by the following:

    Operator Overloading
    Function Overloading
    Function Overridding

  4. Submitted By: hkdua — October 6, 2006
    +5 votes
      + -

    Everyone here has forget about virtual functions. The most important aspect of C++ is that the polymorphism can be achieved by virtual functions.

  5. Submitted By: pinipatel — October 6, 2006
    +1 votes
      + -

    Polymorphisam is having many forms.
    - a particular construct can be executed in different ways.

  6. Submitted By: tbrzuch — October 6, 2006
    +3 votes
      + -

    Polymorphism is one of the main pillars of object oriented programming. It is concept to allow method invocation to be performed always on the most derived object. It is essentially associated with virtually function and late binding idea.

  7. Submitted By: v_gowda — October 6, 2006
    +2 votes
      + -

    Polymorphism is Basically Using the same external interface for different internal structures.

    That means Polymorphism can take more than one form.

    Polymorphism lets u use same functions & operators in differnt way .

    ex: Operator Overloading(Static)
    Function Overloading(Static)

    Virtual Functions(Dynamic)

  8. Submitted By: phil — October 6, 2006
    +2 votes
      + -

    Polymorphism allows objects to have both a static and a dynamic type. The static type is the pointer type; the dynamic type is what it points to. Virtual functions are dispatched based on dynamic type, so a base class pointer can point to a derived object and, using the vtable, call the derived class’ virtual function:

    class Base {

    virtual DoSomething() {…}
    };

    class Derived : public Base {

    virtual DoSomething() {…}
    };

    Base *b = new Derived; // static type Base, dynamic type Derived
    b->DoSomething(); // calls virtual Derived::DoSomething()

  9. Submitted By: Jim Stevens — November 14, 2006
    -2 votes
      + -

    Polymorphism is the result of mixing C with C++

    A side effect of this condition is brain-melt, something generic to Embedded programmers

  10. Submitted By: Al — September 21, 2007
    not yet rated
      + -

    Don’t forget default arguments in addition to function and operator overloading (static polymorphism) and overriding via virtual functions (dynamic).

  11. Submitted By: Saad Zahid — February 3, 2008
    +1 votes
      + -

    A code is better than thousand words. An excellent example is,
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    #include
    using namespace std;

    class CPolygon {
    protected:
    int width, height;
    public:
    void set_values (int a, int b)
    { width=a; height=b; }
    virtual int area ()
    { return (0); }
    };

    class CRectangle: public CPolygon {
    public:
    int area ()
    { return (width * height); }
    };

    class CTriangle: public CPolygon {
    public:
    int area ()
    { return (width * height / 2); }
    };

    int main () {
    CRectangle rect;
    CTriangle trgl;
    CPolygon poly;
    CPolygon * ppoly1 = ▭
    CPolygon * ppoly2 = &trgl;
    CPolygon * ppoly3 = &poly;
    ppoly1->set_values (4,5);
    ppoly2->set_values (4,5);
    ppoly3->set_values (4,5);
    cout area() area() area()

  12. Submitted By: padmakumar — February 18, 2008
    not yet rated
      + -

    Polymorphism is another object oriented term . polymorphism is ability to take more than one meaning or more thhan one form…

    Two types of polymorphism includes:
    1. Dyamic polymorphism:
    2. Static polymorphism:

    In dynamic polymorphism includes a Method overriding and Virtual Method

    In Static polymorphism includes a Method overloadng and operator overloading

  13. Leave an Answer/Comment

    To prove you're a person (not a spam script), type the security text shown in the picture. Click here to regenerate some new text.
    Click to hear an audio file of the anti-spam word

Our Sponsors
Our Sponsors
Contact Us | FAQ | Sitemap | Terms of Use | Privacy Policy | Tell a Friend

Copyright © 1999-2006 Jeeve Technologies LLC. All rights reserved.