Thanks
"Mike Hofer" <kc********@gmail.comschreef in bericht
news:11**********************@n76g2000hsh.googlegr oups.com...
On Mar 15, 10:00 am, "Herfried K. Wagner [MVP]" <hirf-spam-me-
h...@gmx.atwrote:
"André" <a...@dre.tyschrieb:
i defined a class "myclass" in the App_Code directory of my asp.net
application.
i tried both syntaxes and both work.
My question is: is there a difference between both lines and what's the
best?
dim x as new myclass
dim x as new myclass()
Both lines are semantically identical. Personally I prefer the second one
for consistency. VB does not enforce empty parentheses on method
(constructor) calls.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Agreed.
However, it's worth noting that if your class only provides a default
(parameterless) constructor, and you're using Visual Studio .NET
2002/2003, the IDE will remove the empty parentheses automatically.
It's annoying. I prefer to put them in there. (A call to the default
constructor is still, technically, a method call.)