这里有一个简单的问题,当void在AS3中跟随一个函数时它在做什么?
public function sayGoodbye():void { trace("Goodbye from MySubClass");}
Run Code Online (Sandbox Code Playgroud)
void type向编译器指示您编写的函数不会返回任何值,如果您指示其他类型T而不是void,则编译器期望您返回T.
例如:
function foo(a:int):int { // here the compiler expect that somewhere
// in your function you return an int
return a;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1987 次 |
| 最近记录: |