Imports System.Collections Module Module1 Sub Main() 'Initialize an empty Array list Dim intArray As ArrayList = New ArrayList() 'Declare an integer Dim i As Integer 'Populate the arraylist 'Add 5 integers: 10, 20, 30, 40 and 50 For i = 0 To 4 intArray.Add((i + 1) * 10) Next i 'Print each member of the ArrayList Console.WriteLine("Displaying the contents of the array list ") For Each j As Integer In intArray Console.Write("{0} ", j.ToString()) Next j 'Reverse the order of the items in the list and display them intArray.Reverse() Console.WriteLine(vbCrLf + vbCrLf + "Now the list is reversed ") For Each j As Integer In intArray Console.Write("{0} ", j.ToString()) Next j 'Sort the items in the list and display them intArray.Sort() Console.WriteLine(vbCrLf + vbCrLf + "Now the order of the list has been sorted ") For Each j As Integer In intArray Console.Write("{0} ", j.ToString()) Next j 'Clear the items in the list and display them intArray.Clear() Console.WriteLine(vbCrLf + vbCrLf + "Now the list has been cleared ") If (intArray.Count() = 0) Then Console.WriteLine("There array list is empty") End If System.Console.ReadKey() End Sub End Module