T
Tony Johansson
Hello!
I'm reading in a book called Visual C# 2005. In the chapter about Generics
there ia a section about Nullable types.
Here is the text that isn't complete true I think. It says:
"You can also look at the value of a reference type using the Value
property. If HasValue is true, then
you are guarantee a non-null value for Value, but if HasValue is false,
that is, null has been assigned to the variable, then accessing Value will
result in an exception of type System.InvalidOperationException."
Here it says reference type but this is wrong because it's a value type like
the normal primitive types like int, double and also struct is a value type.
For example int? intNullable = null;
Here the variable intNullable is a value not a reference type like they are
claiming in the text.
Do you agree with me here?
//Tony
I'm reading in a book called Visual C# 2005. In the chapter about Generics
there ia a section about Nullable types.
Here is the text that isn't complete true I think. It says:
"You can also look at the value of a reference type using the Value
property. If HasValue is true, then
you are guarantee a non-null value for Value, but if HasValue is false,
that is, null has been assigned to the variable, then accessing Value will
result in an exception of type System.InvalidOperationException."
Here it says reference type but this is wrong because it's a value type like
the normal primitive types like int, double and also struct is a value type.
For example int? intNullable = null;
Here the variable intNullable is a value not a reference type like they are
claiming in the text.
Do you agree with me here?
//Tony