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 normal jit?
What do you understand by vb.net?
write a program to develop a graphic user interface application of marks book with students names and their names.the program should show the following options main menu,add student details,display student details,maximum mark and minimum mark.
How a base class method is hidden?
described weak typing?
What are the parts of the visual basic control?
Explain internal keyword in .net framework?
What are the technology areas that microsoft.net contains?
Described strong typing
my project run very wel in my sytem yhen i am deploying my project on client machine ,after deployment i run my project then it show " can no find server name " what i do .
Explain the services provided by common language infrastructure.
List the types of generations in garbage collector?
What is the difference between convert.tostring and .tostring() method?
Why should you use delegate?
Name some of the features present in vb 2005?