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 type checking in c#?
List down the differences between public, static and void keywords?
What is xslt in c#?
What is the .NET collection class that allows an element to be accessed using a unique key?
Can I get the name of a type at runtime?
When can a derived class override a base class member?
What is an assembly qualified name? Is it a filename? How is it different?
If I have more than one version of one assemblies, then how'll I use old version (how/where to specify version number?)in my application?
What is difference between continue and break in c#?
What is the use of 0 in c#?
What is the difference between null and string empty in c#?
What does addressof operator do in background ?
How would you describe encapsulation in c#?
What is an inheritance in c#?
What are the features of c#?