What happens when i set a variable to nothing in VB.NET? Is it true that nothing equals to default, or am i missing something here?
If it's a value type (like Integer, Double, etc.) setting the variable to Nothing will set it to the default value.
If it's a reference type, it will really be set to Nothing (null value).
In Microsoft's words:
Assigning Nothing to a variable sets it to the default value for its declared type.
If the variable is of a reference type, a value of Nothing means that the variable is not associated with any object. The variable has a null value.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With