Adds an object to the end of the ArrayList.
Imports System
Imports System.Collections
Imports Microsoft.VisualBasic
Public Class SamplesArrayList
Public Shared Sub Main()
Dim myAL As New ArrayList()
myAL.Add("A")
myAL.Add("B")
myAL.Add("C")
myAL.Add("D")
Dim myQueue As New Queue()
myQueue.Enqueue("E")
myQueue.Enqueue("F")
myQueue.Enqueue("G")
myQueue.Enqueue("H")
myQueue.Enqueue("I")
PrintValues(myAL, ControlChars.Tab)
PrintValues(myQueue, ControlChars.Tab)
myAL.AddRange(myQueue)
PrintValues(myAL, ControlChars.Tab)
End Sub
Public Shared Sub PrintValues(myList As IEnumerable, mySeparator As Char)
Dim obj As [Object]
For Each obj In myList
Console.Write( "{0}{1}", mySeparator, obj )
Next obj
Console.WriteLine()
End Sub 'PrintValues
End Class
Related examples in the same category