using System;
using System.Collections;
class Program
{
static void Main()
{
ArrayList al = new ArrayList();
foreach (int n in new int[7] { 0, 1, 2, 3, 4, 5, 6 })
{
al.Add(n);
}
al.RemoveAt(2);
al.Remove(5);
al.Add(79);
foreach (int n in al)
{
Console.WriteLine(n);
}
Console.ReadKey();
}
}
|
Imports System.Collections
Class Program
Private Shared Sub Main()
Dim al As New ArrayList()
For Each n As Integer In New Integer(7) {0, 1, 2, 3, 4, 5, 6}
al.Add(n)
Next
al.RemoveAt(2)
al.Remove(5)
al.Add(79)
For Each n As Integer In al
Console.WriteLine(n)
Next
Console.ReadKey()
End Sub
End Class
|