Are nullable types reference types?

后端 未结 6 826
谎友^
谎友^ 2020-11-30 22:25

When I declare an int as nullable

int? i=null;

Does i here become a reference type?

6条回答
  •  借酒劲吻你
    2020-11-30 22:51

    No, the Nullable type is in fact a struct. The runtime will intelligently handle the setting of a null value for you, giving the appearance of a reference type, when it's not....

提交回复
热议问题