开发者

Variable declaration question mark

开发者 https://www.devze.com 2023-01-06 23:26 出处:网络
I was looking at so开发者_如何学JAVAme existing code and stumbled across a variable declaration I didn\'t understand:

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

精彩评论

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