>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.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s