Dim statement for reference type variable

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there any difference between the following Dim statements? I think they
are the same but which way is the correct (standard) way to declare and
initialize the object variable.

Dim DS as New DSTest
Dim DS as DSTest = New DSTest
 
Hi David,

Thanks for the posts. I'm new to .net. The help for Dim statement
actually mentions not to use Initializer if use New. Since I have seen both
type of Dim, I thought they may be different. But I guess what stated in
Help is not a requirement.


Peter
 
Back
Top