The first position for arrays in VB.NET is zero; same rules apply to any in-built collection/function requiring indexing and to other .NET languages, like C#. On the other hand, "old" VB (VB6 and older or VBA) has zero as first index for arrays and one for in-built functions (this is somehow confusing for people coming from VB to VB.NET). What is common to all the VB versions (.NET and older ones) and different to other languages like C#, is that the number used when instantiating the array (9 in y(9)
) does not indicate its size but its last index (the size of y(9)
is 10).
In summary, your array includes 10 positions: from 0 to 9.