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 is dictionary class in c#?
What are namespaces, and how they are used?
what is garbage collection?
What is wcf c#?
What is a boolean c#?
What happens during the process of boxing?
how can your software identify which version of dot net framework install in client pc and install framework accordingly
4. Describe the process when we send a request URL? And who is responsible for that?
Define delay signing?
If a class is a ref type, how we can pass to a function.
What is array and its types in c#?
Describe the accessibility modifier protected internal.
3 Answers Siebel Systems, Visual Soft,
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)