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
hi all.... i need code snippets for store and retrive tiff fromat images in sqlserver....... kindy provide it.......
What is the purpose of namespace in c#?
Define strong name in c#?
Explain about Oops concept
Can a child class call the constructor of a base class?
What's the difference between a method and a procedure?
What are instance fields in c#?
What is c# and why it is used for?
What are scriptable objects?
Why do we use polymorphism in c#?
What is difference between class and interface in c#?
Can bool be null c#?
Why constructor is used in c#?
What is the difference between structure and class in c#?
Can we change static variable value in c#?