开发者

When to use the "as" keyword and when to use () casting? [duplicate]

This question already has answers here: Closed 12 years ago.

Possible Duplicate:

Direct casting vs 'as' operator?

as doesn't throw an exception, but开发者_运维技巧 wouldn't it result in a NullPointerException later? doesn't it make it harder to debug?


after using the as, you should always check for null.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜