What does the keyword virtual mean in the method definition?
Answer Posted / kiran
Even though the function in base class is declared with
virtual keyword, it is not compulsory that the derived
class must override it.
namespace TestNewOverride
{
class MyBaseClass
{
int a;
public virtual int doubleit()
{
return 2 * a;
}
public MyBaseClass()
{
a = 5;
}
}
class MyDerivedClass:MyBaseClass
{
public static void Main()
{
}
}
}
| Is This Answer Correct ? | 7 Yes | 0 No |
Post New Answer View All Answers
How do you declare a variable in c#?
Can you inherit multiple abstract classes in c#?
Is it true that all c# types derive from a common base class?
What is COM Interoperability?
Is a structure a class?
Can abstract class instantiated c#?
How do I convert a string to an int in c#?
Why data types are important in c#?
What is ienumerable <> in c#?
who is a protected class-level variable available to?
What is iqueryable in c#?
how to insert the data from the grid view to database table though button click.pls send the answer to mail id suri1319@gmail.com
What is the ouput of the following program?
Explain how to implement an object pool in c#.net
What is the difference between console and windows application?