Jeff,
I normally use the first, unless I "need" to use the second.
I "need" to use the second when I am initializing the field from a function
(a factory method that does the New) or I want to declare the variable with
a base class, while initializing it with a sub class.
Dim x As SomeClass = CreateSomeClass(<parameters>)
Dim stream As Stream = New FileStream(<parameters>)
I will use the second when I want to make sure the routine does not use any
subclass specific methods, which in general is not very often.
Hope this helps
Jay
"Jeff Johnson [MVP: VB]" <i.***@enough.spam> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
When declaring a variable and assigning a value to it in one line, which
way do you do it:
Dim x As New SomeClass(<parameters>)
or
Dim x As SomeClass = New SomeClass(<parameters>)
Are there any functional differences between the two?