How does placement of parentheses in VB.NET affect an array (in the actual program)?

Viewed 125

I'm a beginner in VB (working in .NET console application) and I don't understand the difference between these two:

  1. Dim array1 as Integer( ) = New Integer( ) { }

  2. Dim array2( ) as Integer = New Integer( ) { }

I understand that the first one declares an integer variable of an array type and the second declares an array of integer type. But what difference does it make in the program itself?

In my materials both are used in the same way and it contains no explanation as to why use one or the other. Is it because the program executes them the same way?

0 Answers
Related