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 to find Percentage, name ,College from a resume or document ? How to export these values to other page in C#?
Are structs value types or reference types?
What is a class in unity?
Can you change the value of a constant filed after its declaration?
Is c# dictionary a hash table?
hi my question is about understanding a text the user entered to a site , so i want to analyse that text looking for some specific items such as "honda" "shoffere" etc.. so if this site could help or could tell me where to go with such question ,i wonder. thanks
Can abstract class have parameterized constructor?
is it possible to access a remote web service Without UDDI?
Is datetime nullable c#?
What is the main purpose of delegates in c#?
What is a multicast delegate in c#?
Is an array an object c#?
Where do we set the min and max pool size for connection pooling?
2. What happened when BO object has been called?
What is the default value of guid in c#?