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

hi all.... i need code snippets for store and retrive tiff fromat images in sqlserver....... kindy provide it.......

1813


What is the purpose of namespace in c#?

855


Define strong name in c#?

912


Explain about Oops concept

937


Can a child class call the constructor of a base class?

1032


What's the difference between a method and a procedure?

956


What are instance fields in c#?

986


What is c# and why it is used for?

937


What are scriptable objects?

901


Why do we use polymorphism in c#?

881


What is difference between class and interface in c#?

908


Can bool be null c#?

868


Why constructor is used in c#?

890


What is the difference between structure and class in c#?

951


Can we change static variable value in c#?

907