"Ravichandran J.V." <jv************@yahoo.com> wrote
Dim strMyData() as string
means that you are initializing an array of strings
Dim strMyData as string()
is simply wrong syntax. The open and close parentheses at the end of the
statement signifies that you are providing reference to the class
through the default constructor of the class but since you are not using
it with the New keyword it is wrong syntax.
You might want to inform MSFT that syntax is wrong since they
use that syntax in the documentation to explain creating an array!
(See 'New keyword' in VB.Net help)
There is no parameterless constructor for the String class:
strMyData = New String()
That syntax is wrong, which indicates that there is no 'default constructor'
for the String class.
Following primative types with parentheses is another valid data type as
evidensed by:
Dim a As String() = {"X", "Y"}
Dim b As Integer() = {1, 2}
The parentheses indicate the Array class is used to build a strongly typed
array. (Note the array class also has no 'default constructor' and the
desired type is a requirement of the shared CreateInstance method.)
HTH
LFS