Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What are reflections in c#?

888


How do I run a cshtml file?

898


How many types of collections are there in c#?

870


How do I get deterministic finalization in c#?

1043


What is the difference between dynamic and var in c#?

908


What is a property in c#?

897


Why do we overload constructors?

877


Is object an int c#?

907


What is the difference between ienumerable and iqueryable?

941


Explain how obfuscator works in .net

979


Why do you need boxing in c#?

900


What do you mean by saying a "class is a reference type"?

899


What are the 3 types of comments in c#?

929


What is virtual class in C#?

982


What is namespace c#?

908