Variable declaration question mark

后端 未结 2 1594
南方客
南方客 2021-02-18 21:00

I was looking at some existing code and stumbled across a variable declaration I didn\'t understand:

public foo as Boolean?

What does the quest

相关标签:
2条回答
  • 2021-02-18 21:25

    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 讨论(0)
  • 2021-02-18 21:27

    It means a nullable Boolean.

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

    0 讨论(0)
提交回复
热议问题