开发者

Variable declaration question mark

I was looking at so开发者_如何学JAVAme existing code and stumbled across a variable declaration I didn't understand:

public foo as Boolean?

What does the question mark signify?


It means a nullable Boolean.

Boolean?, or any other value type (number or struct), is shorthand for Nullable(Of Boolean).


aah, no sooner did I post the question that I realised that it may signify that it can be nullable.

I tested in code and that seems to be the case.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜