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
What is datarelation c#?
What does do in c#?
Does constructor return any value in c#?
What is msil, and why should developers need an appreciation of it if at all?
Explain a MSIL ? Why is it appreciated by all developers?
without modifying source code if we compile again, will it be generated MSIL again?
Why singleton class is sealed in c#?
Why do we need ienumerable in c#?
what are implementation inheritance and interface inheritance?
What is a concrete class in c#?
What is a method signature in c#?
How does c# generics and c++ templates compare?
What is string method in c#?
Can you have more than one namespace in c#?
Define thread?