Cheung Tat Ming Cheung Tat Ming - 1 year ago 64 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 Source

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

.field private string[] files
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download