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 the uses of namespaces?

958


How to open a new form on button click in Windows forms?

902


To allow an element to be accessed using a unique key which .NET collection class is used ?

1039


What is the difference between == and object.equals?

921


What is the use of delegates in c#?

830


Value Type and Reference Type Data type in C#?

912


What is public, private, protected, internal and internal protected?

904


What is delegates in c#?

847


What is serialization and deserialization in c# with example?

843


How can I use .NET components from COM programs?

840


What is different between Boxing and Unboxing?

949


Are structs value types or reference types?

997


How do I create a multilanguage, single-file assembly?

873


What does exclamation mark mean c#?

947


Explain the different types of delegates used in c#.

887