After reading two blog posts ([1], [2]) about Nullable Types and consulting the beta documentation for .NET 2.0, here is what works in VB.NET (and not more than that from what I can gather):
Dim i As System.Nullable(Of Integer)
i = 10 ‘ Nothing new here | pun intended ;o)
i = Nothing ‘ OK, so this is new… no more boxing/unboxing required then I guess
If (i.HasValue) Then
Console.WriteLine(i)
Else
Console.WriteLine(“Undefined”)
End If
Dim j As Integer
j = i ‘ Works only if i actually has a value…
i = j ‘ Works always. Obviously, because j, being a regular value type, always has a value, even if unassigned./code]
No ? to indicate a nullable type (or other shorthand), no ?? operator to choose between the value of the nullable type instance or an alternative, etc. Hopefully in a future version.