I\'ve tried this code in VB:
Dim a(1) As Byte
Console.WriteLine(a.Length)
The output is \"2\". Anyone any idea why?
The previous answers each have pieces of the correct answer, but not the full correct answer. When you declare an array (Like with your code: Dim a(1) As Byte) the number you put in the array declaration (in this case, 1) is NOT a declaration of how many entries in the array, it is a declaration of the upper boundary of the array.
So, in your declaration, you're creating an array with 2 entries: a(0) and a(1)