What is the Difference between Overriding and overloading?

Answer Posted / yugal

OVERLOADING is the process of declaring the methods having
the same name but diff signatures. Signature means diff
types & number of arguments.
OVERRIDING is the process of overwriting the methods of
base class in Derived Class.

Overriding is the example of run-time polymorphism and
Overloading is the example of compile-time polymorphism.
Overloading

1) Method can have different access specifier.
2) Method can have different return type
3) Method must have same name with different method
signatures.
4) It doesn't need inheritance as method should be in
same class.

Overriding->

1) Method must have same access specifier.
2) Method must have same return type.
3) Method must have same name with same method
signatures.
4) It needs inheritance and virtual keyword before it
declaration.
5) It requires non-static method.

Is This Answer Correct ?    27 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program to find all text files in a logical drive and return the count of the number of files?

2271


What is non_deterministic finalization?

617


What are the advantages of vb.net and c#?

636


So you know which dll is used for microsoft .net run time?

511


What are the difference between dispose(), close(), exit(), end()? When do we use them?

537






how many server control present in .net

2292


Explain an assembly?

569


Described strong typing and weak typing?

622


What is a stream in vb.net?

522


How to retrieve images in sql server database through vb.net?

517


What is the difference between readonly variable and constant variable?

557


what is common type system?

520


Explain how does the xmlserializer work?

590


What is the main use of a namespace?

510


Explain how the .net framework performs automatic memory management.

562