这里有一个简单的问题,当 void 跟随 AS3 中的函数时,它在做什么?
public function sayGoodbye():void { trace("Goodbye from MySubClass");}
void
type 向编译器指示您编写的函数不会返回任何值,另一方面,如果您指示除 void 之外的其他类型 T,编译器期望您返回 T。
Ex:
function foo(a:int):int { // here the compiler expect that somewhere
// in your function you return an int
return a;
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)