What is the difference between announcing new and somehow = something new in vb.net?

I have code like this

Dim s as something = new something
Dim s as new something

who cares? whether there is a?

+4
source share
4 answers

Slight difference.

The first allows you to:

Dim s as ParentType = new InheritedType

The second does not.

The “advantage” of this scan be several different types associated with ParentType without exploding at runtime.

+9
source

There is no difference. These signatures are identical with respect to VB. One has less text :)

+3
source

.

,

Dim s as something = new something

Dim s as new something

, Vb6 (as new VB6 , ). , "" Vb.Net

, Vb.Net , IL.

+1
source

I believe that everything you do is exactly what you do.

-3
source

All Articles