VB.Net calling New without assigning value

Posted by dcp on Stack Overflow See other posts from Stack Overflow or by dcp
Published on 2010-06-10T14:46:40Z Indexed on 2010/06/10 14:53 UTC
Read the original article Hit count: 168

Filed under:
|

In C# I can do this:

new SomeObjectType("abc", 10);

In other words, I can call new without assigning the created instance to any variable. However, in VB.Net it seems I cannot do the same thing.

New SomeObjectType("abc", 10) ' syntax error

Is there a way to do this in VB.Net?

© Stack Overflow or respective owner

Related posts about vb.net

Related posts about constructors