July 2015
Intermediate to advanced
1300 pages
87h 27m
English
The array literals feature works like the local type inference but is specific to arrays. It was first introduced in Visual Basic 2010. Consider this array of strings declaration as you would write it in Visual Basic 2008:
Dim anArrayOfStrings() As String = {"One", "Two", "Three"}
In Visual Basic 2015 you can write it as follows:
'The compiler infers String()Dim anArrayOfStrings = {"One", "Two", "Three"}
According to the preceding code, you are still required to place only a couple of parentheses, but you can omit the type that is correctly inferred by the compiler as you can easily verify by passing the mouse pointer over the variable declaration. Of course, array literals ...