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 is managed code?
Explain the difference between “constant” and “read-only” variables used in c#?
Can we inherit a private class in c#?
Name the two classes are required for implementing a windows service?
What is asax file in c#?
How do I create multifile assembly?
What is the difference between finalize() and dispose() methods?
What does void mean unity?
What is system console writeline in c#?
Define thread? Explain about multithreading?
What is difference between abstraction and encapsulation in c#?
Can we declare private class in c#?
What is better C# or VB.NET?
What are virtual classes in c#?
How does one compare strings in c#?