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...

Can you override private virtual methods?

Answer Posted / vivek

virtual or abstract members cannot be private.

Ex: error occurs during the static compilation phase, which
means that no program that declares a private virtual method
will ever be executed in any way.
C#
class A
{
private virtual int Test()
{
return 1;
}
}

class Program
{
static void Main()
{
}
}

Compile-time error

Error 1
'A.Test()': virtual or abstract members cannot be private

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the correct way of declaring an xml namespace?

828


Why we use dll in c#?

965


What is a callback c#?

1001


How can we make a thread sleep for infinite period ?

1004


Why do we use interfaces in c#?

941


what is a enumeration in c#

1050


Why is c# used?

927


What do you mean by directing?

996


1. Describe page life cycle?

2113


Why do we need properties in c#?

889


What are collections in c#?

912


What is regex replace in c#?

1013


What is difference between list and dictionary in c#?

888


Why do we use overloading in c#?

991


What is semaphore in c#?

951