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 lazy in c#?

0 Answers  


What?s the difference between the System.Array.CopyTo() and System.Array.Clone()?

6 Answers   Wipro,


Can I call a virtual method from a constructor/destructor?

0 Answers  


What is the process of delegation?

0 Answers  


What are expressions c#?

0 Answers  


What are partial classes and use of partial classes?

0 Answers   QuestPond,


what are the events in delegate?

2 Answers   Choice Solutions,


What exception can an overridden method throw in comparison with the method it is overriding?

0 Answers   Changepond,


How garbage collection deals with circular references.

0 Answers  


How does insertion sort work?

0 Answers  


What?s the advantage of using System.Text.StringBuilder over System.String?

1 Answers  


How do I enforce const correctness in c#?

0 Answers  


Categories