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 do you mean by deserialization?
Explain trace in vb.net?
described weak typing?
Explain about visual basic?
What is portable executable?
How do you use two datareaders at the same time in a vb.net windows application ?
What is meant by jagged arrays?
What is the ruby interface generator?
How to retrieve images in sql server database through vb.net?
What is tracing?
What are the parts of the visual basic control?
What are jagged arrays ?
Explain the difference between dispose and finalize()?
Is it necessary to have SQL server installed in your computer in order to create a service based database in vb.net?
Explain convert.tostring and i.tostring method?