What is the difference between "overloading" and "overridding"?

Answer Posted / shakti singh khinchi

Overloading: When more then 1 methods in a class having same
name but they are different in their number of parameters,
different in their parameters types and their order.

Overriding: When a parent class is derived by a child class
and some method which has present in parent class which is
declared as "virtual" in parent class , same method with
same name and parameters and sam type is also declared in
child class without "virtual" keyword, bcz it is by default
virtual in child. SO PARENT AND CHILD CLASS USES SAME METHOD
ARE CALLED OVERRIDING.

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you decide which integer type to use?

586


What are the four partitions in which c++ compiler divides the ram?

713


What are references in c++?

670


How do you declare A pointer to a function which receives nothing and returns nothing

734


Explain the use of virtual destructor?

637






What is a string example?

564


Why do we use double in c++?

610


Is python written in c or c++?

637


When is dynamic checking necessary?

608


What are static and dynamic type checking?

624


What is public, protected, private in c++?

665


Can you explicitly call a destructor on a local variable?

610


Explain what is class definition in c++ ?

609


What is dev c++ used for?

613


Define a constructor - what it is and how it might be called (2 methods)?

614