Nothing in VB.NET is actually equivalent to default(Type) in C #.
So int intResult = default(int); is the equivalent of C #.
According to the VB.NET Language Reference : "Assigning nothing to a variable assigns a default value to the declared type. Type contains variable elements, all of them have default values."
Edit: Regarding the comparison with Nothing : I assume that intResult > Nothing interpreted as intResult > 0 , because the intResult time intResult type is Integer , which defaults to 0. If the intResult type is not known at compile time (for example, this is in Integer box), I suspect this will not compile.
See the Community Content section at the bottom of the VB.NET Language Reference page for a similar example ( Nothing < 2 ).
source share