关于接口
在c sharp中。。用interface定义一个接口后。。这个接口有何作用呢??
2007-09-17 22:28
2007-09-17 22:39
2007-09-17 22:40
2007-09-18 00:30
2007-09-18 00:31
using System;
namespace MyProject
{
interface MyInterface
{
void Display(); // Class1必须实现这个方法
}
class Class1:MyInterface
{
public void Display()
{
Console.WriteLine("Hello World");
}
static void Main(string[] args)
{
MyInter iobj = new Class1();
iobj.Display();
}
}
}

2007-09-18 05:07
2007-09-18 09:16
2007-09-18 09:23

2007-09-18 12:53

2007-09-18 18:53