首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

AS3 承继

2012-10-27 
AS3 继承1. 终止继承? public final class Main {}?? 整个类都不被继承?? AS中的属性不能被重写,所以final

AS3 继承

1. 终止继承

? public final class Main {}?? 整个类都不被继承

?

? AS中的属性不能被重写,所以final不能应用于属性中

?

? public class Main{

?

??? final public function foo():void{}? a

?

??? public final function foo():void{}? b

?

??? a,b两种写法都可以

? }

?

2. 接口继承

?? 接口继承可以是多继承,类继承是单继承

?? public interface? IFather{

????? function a():void ;

????? function b():void ;

?? }

?

?? public interface ISon extends IFather , extends IWindow? {

?????? function c():void ;

?? }

?? 如果有个类你继承了ISon,那么你同样会继承a,b方法 , 父接口不能有重命名的方法

热点排行