Você está na página 1de 1

Overloading and Overriding?

View(s):
38739

What is difference between overloading and overriding?


Answer 1)
Overloading and Overriding both are example of polymorphism. Overriding is dynamic polymorphism while overloading is static polymorphism.
In other words, Overloading is evaluated at compile time whereas Overriding is evaluated at Run Time.
Overriding: Overriding is a changing of behavior of a class in drive class using dynamic polymorphism. For example in C# you have a class A and another class B derives fromA.
Class A have a virtual method abc and in class B using override you given new functionality to this method.
Overloading: Overloading is a mechanism by which we can have two or more different methods using same name.
Overloading can be implemented using different parameter data types, different number of parameters, and different order of parameters.
Asked in: Mahindra Satyam Expertise Level: Beginner
Last updated on Tuesday, 05 July 2011

Copyright 2009 - 2012 mr-ponna.com

4/5 stars (45 vote(s))

Você também pode gostar