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

Explain what observations between vb.net and vc#.net?

722


What is a preprocessor directive in vb.net?

732


difference between control and component more than one differences

2650


Tell me which namespace are used for accessing the data?

717


Can you please explain the difference between namespace and assembly?

734


What are the shared variables?

730


Explain public assembly?

715


What is code access security?

874


When do you use virutal keyword?

768


Explain convert.tostrin?

828


What is misl code?

750


Which classes a dll can contain?

722


Explain the advantages of migrating to vb.net?

707


Explain code security?

685


What are nested classes?

709