can it possible to acees the virthual method using the
override method object?
plz give me the example
Answer Posted / javed khan
public class zzz
{
public static void Main()
{
yyy x = new xxx();
x.test();
}
}
class yyy
{
public virtual void test()
{
System.Console.WriteLine("base calss.");
}
}
class xxx : yyy
{
public override void test()
{
System.Console.WriteLine("derived calss.");
base.test();
}
}
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What do you mean by directing?
What is data hiding in c#?
What is a property in c#?
What is out int in c#?
Define MSIL, and how does it works? Why our developers need an appreciation of it if at all?
How can I check the type of an object at runtime?
Is char * null terminated?
What exactly happens when we debug and build the program?
What is static variable in c#?
When should we use sealed class in c#?
Why do we parse in c#?
What is the boxing and unboxing in c#?
Explain the types of Polymorphism.
Can scriptable objects have methods?
Can you inherit from a sealed class?