Public Class ArrayTest

  Shared Sub Main()
    Dim i As Integer
    Dim max As Integer
    max = 10
    Dim x(10) As Single
    For i = 0 To 10
      x(i) = i
      Console.WriteLine(i.ToString + " " + x(i))
    Next i

    Dim ar As New ArrayList()
    For i = 0 To 9
      ar.Add(i)
    Next i
    For i = 0 To ar.Count - 1
      Console.WriteLine(ar.Item(i))
      Console.WriteLine(ar(i))
    Next i

    Try
      For i = 0 To ar.Count
        Console.Write(ar.Item(i))
      Next i
    Catch e As Exception
      Console.WriteLine(e.Message)
      Console.WriteLine(e.StackTrace)
    End Try

    Console.WriteLine("end of loop")

    For i = 0 To ar.Count
      Console.WriteLine(ar.Item(i))
    Next i
    Console.WriteLine("end of loop")
  End Sub
End Class
