Is Guid considered a value type or reference type?

前端 未结 6 1344
-上瘾入骨i
-上瘾入骨i 2021-01-03 18:32

Guids are created using the new keyword which makes me think it\'s a reference type.

Is this correct?

Guid uid = new Guid();

<
6条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-03 18:56

    It's actually Guid. All types are constructed using the new keyword. You can identify reference types from value types by whether they are a class, interface, or delegate (all reference types), or a struct or enum (value types).

提交回复
热议问题