接口 interface

/*
接口 interface就是一系列公共标准
接口只能包含:方法、属性、索引器、事件。
接口中不能定义字段,不能有构造方法。方法不能实现。不能包含运算符重载
接口中的成员不能有修饰符,因为接口总是公共的。
*/
namespace Frank
{
	public class Test
    {
        public static void Main(string[] args)
        {
			
        }
    }
	public interface ITest2
	{
		int Age{get;set;}
		void Get();
		int Set(int a);
	}
	public interface ITest3:ITest2//不实现父类接口就要定义为接口
	{
		void Info();
	}
	public abstract class Test4:ITest3//必须实现或者定义为抽象方法,不然编译不通过
	{
		public abstract void Info();
	}
}

  

posted on 2013-11-21 15:58  wp456  阅读(175)  评论(0)    收藏  举报

导航