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


Please Help Members By Posting Answers For Below Questions

What is managed code?

616


Explain the difference between “constant” and “read-only” variables used in c#?

613


Can we inherit a private class in c#?

539


Name the two classes are required for implementing a windows service?

651


What is asax file in c#?

640






How do I create multifile assembly?

600


What is the difference between finalize() and dispose() methods?

631


What does void mean unity?

582


What is system console writeline in c#?

546


Define thread? Explain about multithreading?

645


What is difference between abstraction and encapsulation in c#?

616


Can we declare private class in c#?

553


What is better C# or VB.NET?

588


What are virtual classes in c#?

618


How does one compare strings in c#?

620