using System;
using System.Collections.Generic;
using System.Text;
namespace OOPs21
{
class BaseClass
{
public virtual string ShowMe()
{
return "base";
}
}
class DerivedClass : BaseClass
{
public override string ShowMe()
{
return "derive";
}
public static void CallShowME(BaseClass objBC)
{
Console.Write(objBC.ShowMe());
}
public static void Main()
{
DerivedClass vardc = new DerivedClass();
CallShowME(vardc);
Console.Read();
}
}
}
Answer:
derive
www.codecollege.NET
0 comments
Post a Comment