This does not compile.
Dim Tom As New List(Of String) = {"Tom", "Tom2"}
This does
Dim Tom As String() = {"Tom", "Tom2"}
IMO this features should be allowed for all collection types and not only arrays.
This does not compile.
Dim Tom As New List(Of String) = {"Tom", "Tom2"}
This does
Dim Tom As String() = {"Tom", "Tom2"}
IMO this features should be allowed for all collection types and not only arrays.
Microsoft agrees with you. It is supported starting in the next release of VB, VB 2010. See this question: Collection initialization syntax in VB 2008?.
You cannot do this in the current version of Visual Basic, but the next version in Visual Studio 2010 allows this syntax:
Dim Tom As List(Of String) = new List(Of String) From {"Tom", "Tom2"}
It uses the new From keyword.
Edited to Add:
C# has included its Collection Initializer syntax Visual Studio 2008. You can read about it on MSDN.