Polymorphism/C++/Important Points

  1. In C++, polymorphism is achieved through function overloading and operator overloading

  2. The term overloading means a name having two or more distinct meanings.

  3. Overloaded function’ refers to a function having more than one distinct meaning. Overloaded functions have same name but different signatures (Number of
    argument and type of argument)

  4. A function’s argument list is known as a function signature

  5. Two function cannot be overloaded when the only difference is that one takes a reference parameter and the other takes a normal, call-by-value parameter.

  6. Ordinary functions as well member functions can be overloaded
  7. A class can have overloaded constructors where as destructor function cannot be overloaded.

  8. The mechanism of giving special meaning to an operator is known as operator overloading.

  9. Operator overloading provides new definitions for most of the C++ operators. Even user defined types (objects) can be overloaded.

  10. The definition of the overloaded operator is given using the keyword ‘operator’ followed by an operator symbol.

  11. We can overload all the C++ operators except the following:

    Scope resolution operator (::), sizeof(), Conditional operator (?:), Member selection(.) and Member pointer selector (*) operator

Leave a comment

Design a site like this with WordPress.com
Get started