What is function overriding?

devquora
devquora

Posted On: Feb 22, 2018

 

If a user inherits a class into a derived class and provides a definition for one of the base class’s function again inside the derived class, then this function is called an overridden function, and this mechanism is known as function overriding. When the member function exists in both classes (base and derived) is called in the case of overridden functions, the member function of the derived class is invoked, and the function of the base class is ignored.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    C++ Interview Questions

    Explain what is OOP?

    Object-oriented programming (OOP) is a type of computer programming, also more commonly known as software design, in wh..

    C++ Interview Questions

    What is the difference between #import and #include in C++?

    The statement #include is used in C++ to include the source file or import the header files containing definitions of f..

    C++ Interview Questions

    What is ‘this’ pointer?

    The ‘this’ pointer is passed as a hidden argument to all the non-static member method calls and is available as a l..