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 instantiating a class?

983


Is c sharp open source?

926


What’s thread.sleep() in threading ?

1066


What are floating point numbers?

1069


Why do we use reflection in c#?

1005


In a site to turn off cookies for one page which method is followed?

996


What is field in c#?

968


What are classes in c#?

1005


What is the difference between a variable and a literal?

1118


Why do we need dependency injection in c#?

982


What Happens In Memory When You Box And Unbox A Value-type?

925


Why do we use Design Pattern in C#?

1098


What is a framework in c#?

994


What is a hashset c#?

1163


How long does a loop recorder procedure take?

1082