what does this declaration mean :
int ? value
and what is he's equivalent on VB.NET .
Thanks
what does this declaration mean :
int ? value
and what is he's equivalent on VB.NET .
Thanks
It means that this integer is nullable, you can assign a null value to it... try to do that with an integer without a ? and it with throw an exception
Edit: Oh and VB.net will declare a nullable int like this
Dim i As Integer?
int?
is short for Nullable<int>
. The VB.NET equivalent is Nullable(Of Integer)
.
It's declaring a new instance of the Nullable<Int32>
type. int?
is just a shorter way of writing it.
Further Reading
It is a Nullable<int>
data type.
The equivalent in vb is Dim value as Nullable(Of Integer)
or Dim value as Integer?
It's syntatic sugar for
Nullable<int> value
meaning that it can have a null value
Nullable value types. It means that the variable can contain a null value. For more details both for VB.NET and C#.NET view this link http://msdn.microsoft.com/en-us/library/ms235245.aspx
Try to read about nullable on msdn (http://msdn.microsoft.com/en-us/library/b3h38hb0.aspx)
The question mark refers to nullable type in C#. You can try using Nullable (Of Integer) in VB.NET.