我这样问的原因是,您可以使用Value属性将可空类型转换为常规类型。这让我认为常规类型只是包装在可空类型中。
发布于 2011-05-16 12:41:16
是的,它是一个泛型结构:
public struct Nullable<T> where T : struct, new()如果您只看过T?语法,这可能会更令人困惑--但这只是syntactic sugar,编译器将其更改为Nullable<T>。
来源:http://msdn.microsoft.com/en-us/library/b3h38hb0.aspx,http://msdn.microsoft.com/en-us/library/1t3y8s4s.aspx
发布于 2011-05-16 12:41:30
是- 'Nullable Structure'
表示一个对象,其底层类型是一个值类型,该值类型也可以像引用类型一样被赋值为null。
顺便说一句,如果你好奇,你可以使用Reflector来“观察引擎盖下的情况”。
发布于 2011-05-16 12:41:56
根据MSDN "Nullable types are instances of the System.Nullable<T> struct. A nullable type can represent the correct range of values for its underlying value type, plus an additional null value"
https://stackoverflow.com/questions/6013210
复制相似问题