What is the difference between "overloading" and "overridding"?
Answers were Sorted based on User's Feedback
Answer / shivanannd
overloading means that we can use same method with same
name many times for multiple purpose in a class with
difference parameters.
overriding means we can refer a method of a base class with
same name in a derived class with same paameters.
| Is This Answer Correct ? | 8 Yes | 0 No |
Answer / 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 |
Answer / vighnesh
Overloading uses same funtion with different parameters
Overriding Uses same exactly similar funtion prototypes
this used in runtime polimorphism ie Virtual Funtions
| Is This Answer Correct ? | 2 Yes | 0 No |
What is size of string in c++?
What are the steps in the development cycle?
What is atoi?
What is a binary file? List the merits and demerits of the binary file usagein C++.
Explain how a pointer to function can be declared in C++?
Why is standard template library used?
write a program to insert an element into an array
Write a program that takes a 5 digit number and calculates 2 power that number and prints it.
Explain the volatile and mutable keywords.
How can you quickly find the number of elements stored in a static array?
class Foo { const int x; protected: Foo(int f); ~Foo(); }; Foo f; Referring to the sample code above, why will the class declaration not compile? a) The variable x is const. b) The destructor is protected. c) The destructor is not public. d) The constructor is protected. e) There is no default constructor.
What do you mean by abstraction. Explain your answer?