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
Define naming convention?
what is diffrence constructor and destructor in vb
What is the diff between vb mdi form and .net mdi form?
Explain cts?
Explain option strict?
Explain convert.tostrin?
Explain the advantages of migrating to vb.net?
Explain trace in vb.net?
Explain how to store decimal data in .net?
What is the source code for display the picture in button click event?
What is the use of internal keyword?
What are the advantages of vb.net and c#?
What is the feature which is common to all .net languages?
Which is the base class for all the classes in .net framework?
What is a preprocessor directive in vb.net?