class IA_TEST
{
interface ITest
{
void Test();
}
abstract class IATest : ITest
{
public abstract void Test();
}
class MyTest : IATest
{
public override void Test()
{
Console.WriteLine("抽象类实现");
}
}
static void Main()
{
ITest test = new MyTest();
test.Test();
IATest iATest = new MyTest();
iATest.Test();
ITest test1 = iATest;
test1.Test();
Console.ReadKey();
}
}
输出:
抽象类实现
抽象类实现
抽象类实现
标签:IATest,C#,void,接口,ITest,MyTest,Test,抽象类
From: https://www.cnblogs.com/huvjie/p/16812482.html