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.3 接口的继承
C#中的派生类只能有一个基类,不支持类的多重继承,但可以继承多个接口,通过接口实现多继承。如在现实中儿子不但可以继承父亲的财产,如伯父无子女,也可以继承伯父的财产,在C#中这属于多重继承,要用接口来实现,其实接口就是为了实现多重继承而产生的。在C#中接口可以多继承,接口之间可以互相继承,普通类和抽象类可以继承自接口。一个类可以同时继承一个类和多个接口,但是接口不能继承类。
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