Difference between Overloading and Overriding?




Answers were Sorted based on User's Feedback



Answer / swetcha

Overloading - Two functions having same name and return
type, but with different type and/or number of arguments.
Overriding - When a function of base class is re-defined in
the derived class.

Is This Answer Correct ?    846 Yes 105 No

Answer / janet

1. In overloading,there is a relation ship between methods
available in the same class where as in overridding,there
is relationship between a super class method and subclass
method.
2. overloading doesn't block inheritence from the
superclass where as overridding blocks inheritence.

3. in overloading,seperate methods share the same name
where as in overridding,subclass methods replaces the
superclass.

4.overloading must have different method signatures where
as overriding must have same signature.

Is This Answer Correct ?    481 Yes 79 No

Answer / shivanand

The main difference between overloading and overriding is
that in overloading we can use same function name with
different parameters for multiple times for different tasks
with on a class.
and overriding means we can use same name fiunction name
with same parameters of the base class in the derived class.
this is also called as reusability of code in the programme.

Is This Answer Correct ?    309 Yes 67 No




Answer / natarajan

Overloading is compile time binding, where as overriding is
dynamic binding.

Is This Answer Correct ?    149 Yes 40 No

Answer / ramesh pedhamalla

Overloading is compile time binding, where as overriding is
dynamic binding.....

Is This Answer Correct ?    112 Yes 25 No

Answer / gaurav rawat

* in overloading function name are same but signatures
(argument) are different .
while in overriding function name are as well as argument
are same in drive class as in super class.
* for overloading can be done in one class but
for overriding there is necessary that at least two class
should be present.

Is This Answer Correct ?    101 Yes 24 No

Answer / meenu kathuria

overloading: same name but different signatures in same class
overriding: same name and same signature defined in
different class.

Is This Answer Correct ?    103 Yes 34 No

Answer / adeel shahid

overriding is done in the base class where the parent class
method is overridden by a method of the same signature.

Overloading is done in the same class on functions with
input parameters differing in number or type.

Is This Answer Correct ?    98 Yes 36 No

Answer / n.balasutha

It does not block superclass method it will override the
super class method

Is This Answer Correct ?    93 Yes 63 No

Answer / mansi shah

Overloading is evaluaated at compile time whereas
Overriding is evaluated at Run Time.

Overloading method has different Parameters but same name
whereas Overriding is just the implementation of method
define din Base Class.

Overloading does not interfere Base Class whereas
Overriding method must require the method which is declared
in Base Class.

Overloading can be defined in one class,in short term it
does not require separate Base Class to implement the
method,whereas for implementing method overriding the Base
class is necessary..

Is This Answer Correct ?    21 Yes 10 No

Post New Answer



More C++ General Interview Questions

Write a program that takes a 5 digit number and calculates 2 power that number and prints it.

0 Answers   CTS,


When copy constructor can be used?

4 Answers   Symphony,


what are the events occur in intr activated on interrupt vector table

0 Answers   HGS,


What is "strstream" ?

1 Answers   Huawei,


how to access grid view row?

0 Answers  


Write any small program that will compile in "C" but not in "C++"

10 Answers   Honeywell,


sizeof - is it a function or operator?

6 Answers   Honeywell,


In C++ cout is: a) object b) class c) something else

11 Answers   Infosys, Lehman Brothers,


tell me about yourself ?i want answer for frehers with various exasmples?

2 Answers   HCL,


what is c++

0 Answers  


write the prime no program in c++?

16 Answers  


write asingle linked list which read from two list & the do the following 1 sort the prime & nonprime num (prime should be less tn nonprime) 2 each node has a prime num followd by nonprime 3 add a new node into its sutable plce 4 erase the most three duplicated non prime num 5 find the least duplicated prime num

0 Answers   Care,




Categories