Cheung Tat Ming Cheung Tat Ming - 5 months ago 10
Vb.net Question

What's different between Dim files() As String and Dim files As String()?

In this code:

Dim files() As String = Directory.GetFiles("C:/")

Dim files As String() = Directory.GetFiles("C:/")


is there a difference between the statements?

Answer

The two are identical. If you use Reflector, you can see that they are compiled to the same IL:

.field private string[] files