What does the keyword virtual mean in the method definition?
Answers were Sorted based on User's Feedback
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 |
Answer / praseetha sandeep
when you have a method defined in a class which you want
to allow to be implimented by inherited class you can use
virtual function
Is This Answer Correct ? | 4 Yes | 0 No |
What are the properties of string?
Why is the XML InfoSet specification different from the Xml DOM? What does the InfoSet attempt to solve ?
How can we sort an array in c#?
How can you clean up objects holding resources from within the code?
What are expressions c#?
Can a struct have a default constructor (a constructor without parameters) or a destructor in c#?
Hai I am Shiva from TN, SSE.I have an query problem. My Table : Door Field : ID,DoorID,ZoneID,Date,Time,Status. Problem was : Status.We got two values, one is 00 (OUTTIME) , Another is 01(INTIME) Like this Status --------- 00 01 00 01 00 01 00 01 How to Set as Status 00 and 01 , of separate column , Status as Intime,Status as Outtime Like this ----------- InTime OutTime ---------- ----------- 01 00 01 00 01 00 01 00 01 00 01 00 Regards KS kumar
What is dictionary and hashtable in c#?
When a new instance of a type is created, what is the type of method implicitly called?
List the fundamental oop concepts?
What is lazy in c#?
What is the difference between String s(Small s) and String S(Capital S)?