日期:2014-05-17 浏览次数:20866 次
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication2
{
interface IInterface
{
void Method();
}
class BaseClass : IInterface
{
public void Method()
{
Console.WriteLine("BaseClass Method()...");
}
}
class InheritClass : BaseClass
{
public void Method()
{
Console.WriteLine("Inherit Method()...");
}
}
class Program
{
static void Main(string[] args)
{
BaseClass bc = new BaseClass();
InheritClass ic = new InheritClass();
bc.Method();
ic.Method();
IInterface iif = new BaseClass();
iif.Method();
IInterface iif2 = new InheritClass();
iif2.Method();
Console.ReadKey();
}
}
}