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
How do you determine whether a string represents a numeric value?
What is event and delegates in c#?
Is char * null terminated?
What is difference between an Structure and Class?
write program in c# using this instructions name avinash varma ,work experiance<2,nochildren his work experiance is higher than 5 years,more than one children one children name is diwakar,number of years of work eperiance at current company is the ratio of children and work experiance is 0.21 to 0.5
3. Use layered architecture for coding. s.no name description 1 abc xxxxxxxxx 2 abc xxxxxxxxx 3 4 5 6 7 8 Select all Clear all Add Delete Name Description Save close
What is a property in c#?
What is using in c#?
What is activator c#?
What are the access modifiers in c#?
What are native methods?
Is c# difficult to learn?
What is class sortedlist underneath?
What is a bool in c#?
Define c# i/o classes?