开发者

Declare generic class (like Vector) in Actionscript3

As you all know, Vector support type checking by added Type parameter.

var v:Vector.<String> = new Vector.<String>();

I wonder if I am able to cr开发者_StackOverflow中文版eate a custom class that have Type parameter, something like this

var myClassInstance: MyClassDefinition.<String>;

Thank you.

Harry.


ActionScript doesn’t (yet) support generics. Vector is a special case with support hard-coded into the compiler.

See also: Why doesn't ActionScript have “generics”?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜