Reputation: 46591
If I create a class in VB called Test, I noticed I can instantiate it like:
Dim test As New Test
or
Dim test As New Test()
What is the difference?
Upvotes: 2
Views: 638
Reputation: 2178
There isn't one. Both versions will call the parameter-less constructor of the Test class. The second one just has parentheses.
Upvotes: 1
Reputation: 3777
There's no difference, they are the same, VB.NET will ignore the () since no parameters are being passed in.
Upvotes: 6