Friday, September 19, 2008

VB.NET and default values

A reminder for myself more than anything.

In VB.NET 'Nothing' can be used as the default value for any type.  This is the equivalent to 'default(T)' in C#. 

This is especially handy when creating generic methods where you want to return the default value for the generic type.

No comments: