C#Interface 接口(二)

using System;
public class 
{
	public static void Main()
	{
		IWuDang d = getWuDang();
		d.sing();
	}
	public IWuDang getWuDang()
	{

		return new A();
	}
}
public interface IWuDang
{
	void sing();
}
public class A:IWuDang
{
	public void sing()
	{
		Console.WriteLine("sss");
	}
}

 

posted @ 2012-08-04 14:44  妍珊  阅读(417)  评论(0编辑  收藏  举报