What is the Difference between Overriding and overloading?
Answer Posted / veena
overloading:-
-------------- function name same and parameters in the functions are different
class function
{
public string find_big(int a, int b)
{
//source code
}
public string find_big(float a, float b)
{
//source code
}
function overridding:-
------------------------in this function name same and the difference is inherits the 2nd class(derived class) from 1st class(base class)and
use the virtual to base class and override to derived class
virtual:-
----------
if we use virtual then the function calls once. it's c++ style
eg:-
class one
{
public virtual void display()
{
System.Console.WriteLine("one:display");
}
}
class two : one
{
public override void display()
{
System.Console.WriteLine("two:display");
}
}
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What is the class that allows an element to be accessed using unique key?
Explain and brief about rapid application development tool?
What is non_deterministic finalization?
What is redim keyword?
What is the difference between convert.tostring and i.tostring method?
Write a VB.Net console program to check whether a number is perfect or not.
Explain about the feature anonymous type?
Explain the difference between system.string and system.stringbuilder classes?
Explain nested classes?
What are all the parts of .net framework?
What is the main use of a namespace?
What is code security?
Explain convert.tostrin?
What is global assembly cache (gac)?
What is late binding?