Variable declaration question mark

后端 未结 2 1602
南方客
南方客 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:27

    It means a nullable Boolean.

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

提交回复
热议问题