C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
And: This makes the new length of the array 6. There are now three elements at the end that were not there before.
For Each, ForVB.NET program that uses Array.Resize
Module Module1
    Sub Main()
        ' Create array of three elements.
        Dim arr(2) As Integer
        arr(0) = 1
        arr(1) = 2
        arr(2) = 3
        ' Display all elements and the length.
        For Each value As Integer In arr
            Console.Write(value)
            Console.Write(" ")
        Next
        Console.Write("- ")
        Console.WriteLine(arr.Length)
        ' Call Array.Resize.
        Array.Resize(arr, 6)
        ' Display all elements and the length.
        For Each value As Integer In arr
            Console.Write(value)
            Console.Write(" ")
        Next
        Console.Write("- ")
        Console.WriteLine(arr.Length)
    End Sub
End Module
Output
1 2 3 - 3
1 2 3 0 0 0 - 6
Note: You can use Array.Resize to develop your own resizable collections as well.