Warning: Undefined array key 0 in /www/wwwroot/w/show/success.php on line 266
Warning: Trying to access array offset on value of type null in /www/wwwroot/w/show/success.php on line 266
Warning: Undefined array key 0 in /www/wwwroot/w/show/success.php on line 266
Warning: Trying to access array offset on value of type null in /www/wwwroot/w/show/success.php on line 266
10.3.1 接口的定义
接口用来描述一种程序的规定,可定义属于任何类或结构的一组相关行为。接口可由方法、属性、事件、索引器或这4种成员类型的任何组合构成。接口不能包含常数、字段、运算符、实例构造函数、析构函数或类型,也不能包含任何种类的静态成员。接口成员一定是公共的。
定义接口的语法如下。
<访问修饰符> interface 接口名
{
//接口主体
}
接口不能包含其所定义的成员的任何实现语句,接口只指定实现该接口的类或必须提供的成员。
Warning: Undefined array key 0 in /www/wwwroot/w/show/success.php on line 276
Warning: Trying to access array offset on value of type null in /www/wwwroot/w/show/success.php on line 276
Warning: Undefined array key 0 in /www/wwwroot/w/show/success.php on line 276
Warning: Trying to access array offset on value of type null in /www/wwwroot/w/show/success.php on line 276