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 are the different types of a stream?
how to deploy vb.net with key and evaluation time? any one can help me?
Write the role of new keyword?
Explain manifest?
what is diffrence constructor and destructor in vb
Explain option strict?
What is code security?
What is multiple form in vb?
Can we use Vb.Net and C# language simultaneously in one .Net application?
What are the technology areas that microsoft.net contains?
What is the differences between dataset.clone and dataset.copy?
Explain the difference between dispose and finalize()?
How to store images in sql server database through vb.net?
What is globalization?
Explain about the performance of visual basic?