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?

Answers were Sorted based on User's Feedback



What does the keyword virtual mean in the method definition?..

Answer / venu gopal

The method can be over-ridden.

Is This Answer Correct ?    16 Yes 2 No

What does the keyword virtual mean in the method definition?..

Answer / 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

What does the keyword virtual mean in the method definition?..

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

Post New Answer

More C Sharp Interview Questions

What is the difference between gettype and typeof in c#?

0 Answers  


What are winforms in c#?

0 Answers  


How to implement singleton design pattern in c#?

0 Answers  


Can you override private virtual methods?

11 Answers   AROBS Transilvania Software, IBM, Mind Tree, Revalsys,


What do you understand by an Implicit Variable?

0 Answers   CGI,


Does C# support multiple inheritance?

5 Answers  


Is a games console a computer?

0 Answers  


My switch statement works differently! Why?

0 Answers  


What is the use of partial methods?

0 Answers  


Is c# slower than java?

0 Answers  


Explain the three services model (three-tier application). Presentation (ui), business (logic and underlying code) and data (from storage or other sources).

0 Answers  


Why do we use threads in c#?

0 Answers  


Categories