<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FC_Sharp_by_API%2FSystem.Collections%2FArrayList</id>
		<title>Csharp/C Sharp by API/System.Collections/ArrayList - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FC_Sharp_by_API%2FSystem.Collections%2FArrayList"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp_by_API/System.Collections/ArrayList&amp;action=history"/>
		<updated>2026-04-29T22:37:02Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/C_Sharp_by_API/System.Collections/ArrayList&amp;diff=4044&amp;oldid=prev</id>
		<title> в 15:31, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp_by_API/System.Collections/ArrayList&amp;diff=4044&amp;oldid=prev"/>
				<updated>2010-05-26T15:31:35Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 15:31, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/C_Sharp_by_API/System.Collections/ArrayList&amp;diff=4045&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp_by_API/System.Collections/ArrayList&amp;diff=4045&amp;oldid=prev"/>
				<updated>2010-05-26T12:08:56Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==ArrayList.Add==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.Text;&lt;br /&gt;
class Program {&lt;br /&gt;
    static void Main(string[] args) {&lt;br /&gt;
        ArrayList baseballTeams = new ArrayList();&lt;br /&gt;
        baseballTeams.Add(&amp;quot;S&amp;quot;);&lt;br /&gt;
        baseballTeams.Add(&amp;quot;r&amp;quot;);&lt;br /&gt;
        baseballTeams.Add(&amp;quot;F&amp;quot;);&lt;br /&gt;
        string[] myStringArray = new string[2];&lt;br /&gt;
        myStringArray[0] = &amp;quot;G&amp;quot;;&lt;br /&gt;
        myStringArray[1] = &amp;quot;L&amp;quot;;&lt;br /&gt;
        baseballTeams.AddRange(myStringArray);&lt;br /&gt;
        foreach (string item in baseballTeams) {&lt;br /&gt;
            Console.Write(item + &amp;quot;\n&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==ArrayList.AddRange==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;  &lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
using System.Collections.Specialized;&lt;br /&gt;
class MyClass{&lt;br /&gt;
   public string MyName=&amp;quot;&amp;quot;;   &lt;br /&gt;
}&lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
  static void Main(string[] args)&lt;br /&gt;
  {&lt;br /&gt;
    ArrayList classList = new ArrayList();&lt;br /&gt;
    classList.AddRange(new MyClass[] { new MyClass(), &lt;br /&gt;
                                           new MyClass(), &lt;br /&gt;
                                           new MyClass()});&lt;br /&gt;
    Console.WriteLine(&amp;quot;Items in List: {0}&amp;quot;, classList.Count);&lt;br /&gt;
    // Print out current values. &lt;br /&gt;
    foreach(MyClass c in classList)&lt;br /&gt;
    {&lt;br /&gt;
      Console.WriteLine(&amp;quot;MyClass name: {0}&amp;quot;, c.MyName);  &lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==ArrayList.BinarySearch==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;  &lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
class Album : IComparable, ICloneable {&lt;br /&gt;
    private string _Title;&lt;br /&gt;
    private string _Artist;&lt;br /&gt;
    public Album(string artist, string title) {&lt;br /&gt;
        _Artist = artist;&lt;br /&gt;
        _Title = title;&lt;br /&gt;
    }&lt;br /&gt;
    public string Title {&lt;br /&gt;
        get {&lt;br /&gt;
            return _Title;&lt;br /&gt;
        }&lt;br /&gt;
        set {&lt;br /&gt;
            _Title = value;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    public string Artist {&lt;br /&gt;
        get {&lt;br /&gt;
            return _Artist;&lt;br /&gt;
        }&lt;br /&gt;
        set {&lt;br /&gt;
            _Artist = value;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    public override string ToString() {&lt;br /&gt;
        return _Artist + &amp;quot;,\t&amp;quot; + _Title;&lt;br /&gt;
    }&lt;br /&gt;
    public int CompareTo(object o) {&lt;br /&gt;
        Album other = o as Album;&lt;br /&gt;
        if (other == null)&lt;br /&gt;
            throw new ArgumentException();&lt;br /&gt;
        if (_Artist != other._Artist)&lt;br /&gt;
            return _Artist.rupareTo(other._Artist);&lt;br /&gt;
        else&lt;br /&gt;
            return _Title.rupareTo(other._Title);&lt;br /&gt;
    }&lt;br /&gt;
    public object Clone() {&lt;br /&gt;
        return new Album(_Artist, _Title);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
class TitleComparer : IComparer {&lt;br /&gt;
    public int Compare(object l, object r) {&lt;br /&gt;
        Album left = l as Album;&lt;br /&gt;
        Album right = r as Album;&lt;br /&gt;
        if ((left == null) || (right == null))&lt;br /&gt;
            throw new ArgumentException();&lt;br /&gt;
        if (left.Title != right.Title)&lt;br /&gt;
            return left.Title.rupareTo(right.Title);&lt;br /&gt;
        else&lt;br /&gt;
            return left.Artist.rupareTo(right.Artist);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
class Class1 {&lt;br /&gt;
    static void Main(string[] args) {&lt;br /&gt;
        ArrayList arr = new ArrayList();&lt;br /&gt;
        arr.Add(new Album(&amp;quot;G&amp;quot;, &amp;quot;A&amp;quot;));&lt;br /&gt;
        arr.Add(new Album(&amp;quot;B&amp;quot;, &amp;quot;G&amp;quot;));&lt;br /&gt;
        arr.Add(new Album(&amp;quot;S&amp;quot;, &amp;quot;A&amp;quot;));&lt;br /&gt;
        arr.Sort();&lt;br /&gt;
   &lt;br /&gt;
        try {&lt;br /&gt;
            foreach (Album a in arr) {&lt;br /&gt;
                Console.WriteLine(a);&lt;br /&gt;
            }&lt;br /&gt;
        } catch (System.InvalidCastException e) {&lt;br /&gt;
        }&lt;br /&gt;
        arr.Sort(new TitleComparer());&lt;br /&gt;
        foreach (Album a in arr) {&lt;br /&gt;
            Console.WriteLine(a);&lt;br /&gt;
        }&lt;br /&gt;
        Album l = new Album(&amp;quot;L&amp;quot;, &amp;quot;G&amp;quot;);&lt;br /&gt;
        arr.Sort();&lt;br /&gt;
        int index = arr.BinarySearch(l);&lt;br /&gt;
        Console.WriteLine(index.ToString());&lt;br /&gt;
        arr.Sort(new TitleComparer());&lt;br /&gt;
        index = arr.BinarySearch(l, new TitleComparer());&lt;br /&gt;
        Console.WriteLine(index.ToString());&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==ArrayList.Capacity==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;  &lt;br /&gt;
using System; &lt;br /&gt;
using System.Collections; &lt;br /&gt;
 &lt;br /&gt;
public class ArrayListDemo { &lt;br /&gt;
  public static void Main() { &lt;br /&gt;
    ArrayList al = new ArrayList(); &lt;br /&gt;
     &lt;br /&gt;
    Console.WriteLine(&amp;quot;Initial capacity: &amp;quot; + al.Capacity); &lt;br /&gt;
    Console.WriteLine(&amp;quot;Initial number of elements: &amp;quot; + al.Count); &lt;br /&gt;
 &lt;br /&gt;
    Console.WriteLine(); &lt;br /&gt;
 &lt;br /&gt;
    Console.WriteLine(&amp;quot;Adding 6 elements&amp;quot;); &lt;br /&gt;
    // Add elements to the array list &lt;br /&gt;
    al.Add(&amp;quot;C&amp;quot;); &lt;br /&gt;
    al.Add(&amp;quot;A&amp;quot;); &lt;br /&gt;
    al.Add(&amp;quot;E&amp;quot;); &lt;br /&gt;
    al.Add(&amp;quot;B&amp;quot;); &lt;br /&gt;
    al.Add(&amp;quot;D&amp;quot;); &lt;br /&gt;
    al.Add(&amp;quot;F&amp;quot;); &lt;br /&gt;
 &lt;br /&gt;
    Console.WriteLine(&amp;quot;Current capacity: &amp;quot; + &lt;br /&gt;
                       al.Capacity); &lt;br /&gt;
    Console.WriteLine(&amp;quot;Number of elements: &amp;quot; + &lt;br /&gt;
                       al.Count); &lt;br /&gt;
 &lt;br /&gt;
    // Display the array list using array indexing. &lt;br /&gt;
    Console.Write(&amp;quot;Current contents: &amp;quot;); &lt;br /&gt;
    for(int i=0; i &amp;lt; al.Count; i++) &lt;br /&gt;
      Console.Write(al[i] + &amp;quot; &amp;quot;); &lt;br /&gt;
    Console.WriteLine(&amp;quot;\n&amp;quot;); &lt;br /&gt;
 &lt;br /&gt;
    Console.WriteLine(&amp;quot;Removing 2 elements&amp;quot;); &lt;br /&gt;
    // Remove elements from the array list. &lt;br /&gt;
    al.Remove(&amp;quot;F&amp;quot;); &lt;br /&gt;
    al.Remove(&amp;quot;A&amp;quot;); &lt;br /&gt;
 &lt;br /&gt;
    Console.WriteLine(&amp;quot;Current capacity: &amp;quot; + &lt;br /&gt;
                       al.Capacity); &lt;br /&gt;
    Console.WriteLine(&amp;quot;Number of elements: &amp;quot; + &lt;br /&gt;
                       al.Count); &lt;br /&gt;
 &lt;br /&gt;
    // Use foreach loop to display the list. &lt;br /&gt;
    Console.Write(&amp;quot;Contents: &amp;quot;); &lt;br /&gt;
    foreach(char c in al) &lt;br /&gt;
      Console.Write(c + &amp;quot; &amp;quot;); &lt;br /&gt;
    Console.WriteLine(&amp;quot;\n&amp;quot;); &lt;br /&gt;
 &lt;br /&gt;
    Console.WriteLine(&amp;quot;Adding 20 more elements&amp;quot;); &lt;br /&gt;
    // Add enough elements to force al to grow. &lt;br /&gt;
    for(int i=0; i &amp;lt; 20; i++) &lt;br /&gt;
      al.Add((char)(&amp;quot;a&amp;quot; + i)); &lt;br /&gt;
    Console.WriteLine(&amp;quot;Current capacity: &amp;quot; + &lt;br /&gt;
                       al.Capacity); &lt;br /&gt;
    Console.WriteLine(&amp;quot;Number of elements after adding 20: &amp;quot; + &lt;br /&gt;
                       al.Count); &lt;br /&gt;
    Console.Write(&amp;quot;Contents: &amp;quot;); &lt;br /&gt;
    foreach(char c in al) &lt;br /&gt;
      Console.Write(c + &amp;quot; &amp;quot;); &lt;br /&gt;
    Console.WriteLine(&amp;quot;\n&amp;quot;); &lt;br /&gt;
 &lt;br /&gt;
    // Change contents using array indexing. &lt;br /&gt;
    Console.WriteLine(&amp;quot;Change first three elements&amp;quot;); &lt;br /&gt;
    al[0] = &amp;quot;X&amp;quot;; &lt;br /&gt;
    al[1] = &amp;quot;Y&amp;quot;; &lt;br /&gt;
    al[2] = &amp;quot;Z&amp;quot;; &lt;br /&gt;
    Console.Write(&amp;quot;Contents: &amp;quot;); &lt;br /&gt;
    foreach(char c in al) &lt;br /&gt;
      Console.Write(c + &amp;quot; &amp;quot;); &lt;br /&gt;
    Console.WriteLine(); &lt;br /&gt;
  } &lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==ArrayList.Clear()==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;  &lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
  static void Main(string[] args)&lt;br /&gt;
  {&lt;br /&gt;
    ArrayList a = new ArrayList(10);&lt;br /&gt;
    int x = 0;&lt;br /&gt;
    a.Add( ++x);&lt;br /&gt;
    a.Add( ++x);&lt;br /&gt;
    a.Add( ++x);&lt;br /&gt;
    a.Add( ++x);&lt;br /&gt;
    a.Remove(x);&lt;br /&gt;
    &lt;br /&gt;
    a.RemoveAt(0);&lt;br /&gt;
    a.Clear();&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==ArrayList.Clone==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;  &lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
public class Starter {&lt;br /&gt;
    public static void Main(string[] argv) {&lt;br /&gt;
        ArrayList al1 = new ArrayList();&lt;br /&gt;
        foreach (string arg in argv) {&lt;br /&gt;
            al1.Add(int.Parse(arg));&lt;br /&gt;
        }&lt;br /&gt;
        al1.Sort();&lt;br /&gt;
        ArrayList al2 = (ArrayList)al1.Clone();&lt;br /&gt;
        for (int count = 0; count &amp;lt; al2.Count; ++count) {&lt;br /&gt;
            al2[count] = ((int)al2[count]) * 2;&lt;br /&gt;
        }&lt;br /&gt;
        foreach (int number in al2) {&lt;br /&gt;
            Console.WriteLine(number);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==ArrayList.Contains==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
  public static void Main()&lt;br /&gt;
  {&lt;br /&gt;
    ArrayList myArrayList = new ArrayList();&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    string[] anotherStringArray = {&amp;quot;Here&amp;quot;s&amp;quot;, &amp;quot;some&amp;quot;, &amp;quot;more&amp;quot;, &amp;quot;text&amp;quot;};&lt;br /&gt;
    myArrayList.SetRange(0, anotherStringArray);&lt;br /&gt;
&lt;br /&gt;
    if (myArrayList.Contains(&amp;quot;text&amp;quot;))&lt;br /&gt;
    {&lt;br /&gt;
      int index = myArrayList.IndexOf(&amp;quot;text&amp;quot;);&lt;br /&gt;
      Console.WriteLine(&amp;quot;myArrayList does contain the word &amp;quot;text&amp;quot;&amp;quot;);&lt;br /&gt;
      Console.WriteLine(&amp;quot;&amp;quot;text&amp;quot; first occurs at index &amp;quot; + index);&lt;br /&gt;
      index = myArrayList.LastIndexOf(&amp;quot;text&amp;quot;);&lt;br /&gt;
      Console.WriteLine(&amp;quot;&amp;quot;text&amp;quot; last occurs at index &amp;quot; + index);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==ArrayList.CopyTo==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;  &lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
    public static void Main(string[] args)&lt;br /&gt;
    {&lt;br /&gt;
        // Create a new ArrayList and populate it.&lt;br /&gt;
        ArrayList list = new ArrayList(5);&lt;br /&gt;
        list.Add(&amp;quot;B&amp;quot;);&lt;br /&gt;
        list.Add(&amp;quot;G&amp;quot;);&lt;br /&gt;
        list.Add(&amp;quot;J&amp;quot;);&lt;br /&gt;
        list.Add(&amp;quot;S&amp;quot;);&lt;br /&gt;
        list.Add(&amp;quot;M&amp;quot;);&lt;br /&gt;
        &lt;br /&gt;
        string[] array1 = new string[list.Count];&lt;br /&gt;
        list.CopyTo(array1, 0);&lt;br /&gt;
        Console.WriteLine(&amp;quot;Array 1:&amp;quot;);&lt;br /&gt;
        foreach (string s in array1) &lt;br /&gt;
        { &lt;br /&gt;
            Console.WriteLine(&amp;quot;\t{0}&amp;quot;,s); &lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==ArrayList.GetEnumerator()==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;  &lt;br /&gt;
using System; &lt;br /&gt;
using System.Collections; &lt;br /&gt;
 &lt;br /&gt;
class MainClass {  &lt;br /&gt;
  public static void Main() { &lt;br /&gt;
    ArrayList list = new ArrayList(1); &lt;br /&gt;
 &lt;br /&gt;
    for(int i=0; i &amp;lt; 10; i++) &lt;br /&gt;
      list.Add(i); &lt;br /&gt;
 &lt;br /&gt;
    IEnumerator etr = list.GetEnumerator(); &lt;br /&gt;
    while(etr.MoveNext())  &lt;br /&gt;
      Console.Write(etr.Current + &amp;quot; &amp;quot;); &lt;br /&gt;
 &lt;br /&gt;
    Console.WriteLine(); &lt;br /&gt;
 &lt;br /&gt;
     &lt;br /&gt;
    etr.Reset(); &lt;br /&gt;
    while(etr.MoveNext())  &lt;br /&gt;
      Console.Write(etr.Current + &amp;quot; &amp;quot;); &lt;br /&gt;
 &lt;br /&gt;
    Console.WriteLine(); &lt;br /&gt;
  } &lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==ArrayList.GetRange==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt; &lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
  public static void Main()&lt;br /&gt;
  {&lt;br /&gt;
    ArrayList myArrayList = new ArrayList();&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    string[] anotherStringArray = {&amp;quot;Here&amp;quot;s&amp;quot;, &amp;quot;some&amp;quot;, &amp;quot;more&amp;quot;, &amp;quot;text&amp;quot;};&lt;br /&gt;
    myArrayList.SetRange(0, anotherStringArray);&lt;br /&gt;
    ArrayList anotherArrayList = myArrayList.GetRange(1, 2);&lt;br /&gt;
    DisplayArrayList(&amp;quot;anotherArrayList&amp;quot;, anotherArrayList);&lt;br /&gt;
  }&lt;br /&gt;
  public static void DisplayArrayList(string arrayListName, ArrayList myArrayList)&lt;br /&gt;
  {&lt;br /&gt;
    for (int i = 0; i &amp;lt; myArrayList.Count; i++){&lt;br /&gt;
      Console.WriteLine(arrayListName + &amp;quot;[&amp;quot; + i + &amp;quot;] = &amp;quot; +&lt;br /&gt;
        myArrayList[i]);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==ArrayList.IndexOf==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
  public static void Main()&lt;br /&gt;
  {&lt;br /&gt;
    ArrayList myArrayList = new ArrayList();&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    string[] anotherStringArray = {&amp;quot;Here&amp;quot;s&amp;quot;, &amp;quot;some&amp;quot;, &amp;quot;more&amp;quot;, &amp;quot;text&amp;quot;};&lt;br /&gt;
    myArrayList.SetRange(0, anotherStringArray);&lt;br /&gt;
&lt;br /&gt;
    if (myArrayList.Contains(&amp;quot;text&amp;quot;))&lt;br /&gt;
    {&lt;br /&gt;
      int index = myArrayList.IndexOf(&amp;quot;text&amp;quot;);&lt;br /&gt;
      Console.WriteLine(&amp;quot;myArrayList does contain the word &amp;quot;text&amp;quot;&amp;quot;);&lt;br /&gt;
      Console.WriteLine(&amp;quot;&amp;quot;text&amp;quot; first occurs at index &amp;quot; + index);&lt;br /&gt;
      index = myArrayList.LastIndexOf(&amp;quot;text&amp;quot;);&lt;br /&gt;
      Console.WriteLine(&amp;quot;&amp;quot;text&amp;quot; last occurs at index &amp;quot; + index);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==ArrayList.Insert==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;  &lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
using System.Collections.Specialized;&lt;br /&gt;
class MyClass{&lt;br /&gt;
   public string MyName=&amp;quot;&amp;quot;;   &lt;br /&gt;
}&lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
  static void Main(string[] args)&lt;br /&gt;
  {&lt;br /&gt;
    ArrayList classList = new ArrayList();&lt;br /&gt;
    classList.AddRange(new MyClass[] { new MyClass(), &lt;br /&gt;
                                           new MyClass(), &lt;br /&gt;
                                           new MyClass()});&lt;br /&gt;
    Console.WriteLine(&amp;quot;Items in List: {0}&amp;quot;, classList.Count);&lt;br /&gt;
    classList.Insert(2, new MyClass());&lt;br /&gt;
    Console.WriteLine(&amp;quot;Items in classList: {0}&amp;quot;, classList.Count);&lt;br /&gt;
    // Print out current values. &lt;br /&gt;
    foreach(MyClass c in classList)&lt;br /&gt;
    {&lt;br /&gt;
      Console.WriteLine(&amp;quot;MyClass name: {0}&amp;quot;, c.MyName);  &lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==ArrayList.InsertRange()==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;  &lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
  public static void Main()&lt;br /&gt;
  {&lt;br /&gt;
    ArrayList myArrayList = new ArrayList();&lt;br /&gt;
    &lt;br /&gt;
    myArrayList.Add(&amp;quot;is&amp;quot;);&lt;br /&gt;
    myArrayList.Insert(1, &amp;quot;is&amp;quot;);&lt;br /&gt;
    string[] myStringArray = {&amp;quot;a&amp;quot;, &amp;quot;test&amp;quot;};&lt;br /&gt;
    myArrayList.AddRange(myStringArray);&lt;br /&gt;
    string[] anotherStringArray = {&amp;quot;Here&amp;quot;s&amp;quot;, &amp;quot;some&amp;quot;, &amp;quot;more&amp;quot;, &amp;quot;text&amp;quot;};&lt;br /&gt;
    myArrayList.InsertRange(myArrayList.Count, anotherStringArray);&lt;br /&gt;
    DisplayArrayList(&amp;quot;myArrayList&amp;quot;, myArrayList);&lt;br /&gt;
  }&lt;br /&gt;
  public static void DisplayArrayList(string arrayListName, ArrayList myArrayList)&lt;br /&gt;
  {&lt;br /&gt;
    for (int i = 0; i &amp;lt; myArrayList.Count; i++){&lt;br /&gt;
      Console.WriteLine(arrayListName + &amp;quot;[&amp;quot; + i + &amp;quot;] = &amp;quot; +&lt;br /&gt;
        myArrayList[i]);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==ArrayList.IsFixedSize==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;  &lt;br /&gt;
 &lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
  public static void Main()&lt;br /&gt;
  {&lt;br /&gt;
    ArrayList myArrayList = new ArrayList();&lt;br /&gt;
    &lt;br /&gt;
    Console.WriteLine(&amp;quot;myArrayList.IsFixedSize = &amp;quot; + myArrayList.IsFixedSize);&lt;br /&gt;
    Console.WriteLine(&amp;quot;myArrayList.IsReadOnly = &amp;quot; + myArrayList.IsReadOnly);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==ArrayList.IsReadOnly==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;  &lt;br /&gt;
 &lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
  public static void Main()&lt;br /&gt;
  {&lt;br /&gt;
    ArrayList myArrayList = new ArrayList();&lt;br /&gt;
    &lt;br /&gt;
    Console.WriteLine(&amp;quot;myArrayList.IsFixedSize = &amp;quot; + myArrayList.IsFixedSize);&lt;br /&gt;
    Console.WriteLine(&amp;quot;myArrayList.IsReadOnly = &amp;quot; + myArrayList.IsReadOnly);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==ArrayList.LastIndexOf==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
  public static void Main()&lt;br /&gt;
  {&lt;br /&gt;
    ArrayList myArrayList = new ArrayList();&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    string[] anotherStringArray = {&amp;quot;Here&amp;quot;s&amp;quot;, &amp;quot;some&amp;quot;, &amp;quot;more&amp;quot;, &amp;quot;text&amp;quot;};&lt;br /&gt;
    myArrayList.SetRange(0, anotherStringArray);&lt;br /&gt;
&lt;br /&gt;
    if (myArrayList.Contains(&amp;quot;text&amp;quot;))&lt;br /&gt;
    {&lt;br /&gt;
      int index = myArrayList.IndexOf(&amp;quot;text&amp;quot;);&lt;br /&gt;
      Console.WriteLine(&amp;quot;myArrayList does contain the word &amp;quot;text&amp;quot;&amp;quot;);&lt;br /&gt;
      Console.WriteLine(&amp;quot;&amp;quot;text&amp;quot; first occurs at index &amp;quot; + index);&lt;br /&gt;
      index = myArrayList.LastIndexOf(&amp;quot;text&amp;quot;);&lt;br /&gt;
      Console.WriteLine(&amp;quot;&amp;quot;text&amp;quot; last occurs at index &amp;quot; + index);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==ArrayList.Remove==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
  public static void Main()&lt;br /&gt;
  {&lt;br /&gt;
    ArrayList myArrayList = new ArrayList();&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    string[] anotherStringArray = {&amp;quot;Here&amp;quot;s&amp;quot;, &amp;quot;some&amp;quot;, &amp;quot;more&amp;quot;, &amp;quot;text&amp;quot;};&lt;br /&gt;
    myArrayList.SetRange(0, anotherStringArray);&lt;br /&gt;
&lt;br /&gt;
    myArrayList.RemoveAt(0);&lt;br /&gt;
    myArrayList.Remove(&amp;quot;text&amp;quot;);&lt;br /&gt;
    myArrayList.RemoveRange(3, 2);&lt;br /&gt;
    DisplayArrayList(&amp;quot;myArrayList&amp;quot;, myArrayList);&lt;br /&gt;
  }&lt;br /&gt;
  public static void DisplayArrayList(string arrayListName, ArrayList myArrayList)&lt;br /&gt;
  {&lt;br /&gt;
    for (int i = 0; i &amp;lt; myArrayList.Count; i++){&lt;br /&gt;
      Console.WriteLine(arrayListName + &amp;quot;[&amp;quot; + i + &amp;quot;] = &amp;quot; +&lt;br /&gt;
        myArrayList[i]);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==ArrayList.RemoveAt==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;  &lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
  static void Main(string[] args)&lt;br /&gt;
  {&lt;br /&gt;
    ArrayList a = new ArrayList(10);&lt;br /&gt;
    int x = 0;&lt;br /&gt;
    a.Add( ++x);&lt;br /&gt;
    a.Add( ++x);&lt;br /&gt;
    a.Add( ++x);&lt;br /&gt;
&lt;br /&gt;
    a.Remove(x);&lt;br /&gt;
    &lt;br /&gt;
    a.RemoveAt(0);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==ArrayList.RemoveRange==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
  public static void Main()&lt;br /&gt;
  {&lt;br /&gt;
    ArrayList myArrayList = new ArrayList();&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    string[] anotherStringArray = {&amp;quot;Here&amp;quot;s&amp;quot;, &amp;quot;some&amp;quot;, &amp;quot;more&amp;quot;, &amp;quot;text&amp;quot;};&lt;br /&gt;
    myArrayList.SetRange(0, anotherStringArray);&lt;br /&gt;
&lt;br /&gt;
    myArrayList.RemoveAt(0);&lt;br /&gt;
    myArrayList.Remove(&amp;quot;text&amp;quot;);&lt;br /&gt;
    myArrayList.RemoveRange(3, 2);&lt;br /&gt;
    DisplayArrayList(&amp;quot;myArrayList&amp;quot;, myArrayList);&lt;br /&gt;
  }&lt;br /&gt;
  public static void DisplayArrayList(string arrayListName, ArrayList myArrayList)&lt;br /&gt;
  {&lt;br /&gt;
    for (int i = 0; i &amp;lt; myArrayList.Count; i++){&lt;br /&gt;
      Console.WriteLine(arrayListName + &amp;quot;[&amp;quot; + i + &amp;quot;] = &amp;quot; +&lt;br /&gt;
        myArrayList[i]);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==ArrayList.Reverse()==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt; &lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
  public static void Main()&lt;br /&gt;
  {&lt;br /&gt;
    ArrayList myArrayList = new ArrayList();&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    string[] anotherStringArray = {&amp;quot;Here&amp;quot;s&amp;quot;, &amp;quot;some&amp;quot;, &amp;quot;more&amp;quot;, &amp;quot;text&amp;quot;};&lt;br /&gt;
    myArrayList.SetRange(0, anotherStringArray);&lt;br /&gt;
    myArrayList.Reverse();&lt;br /&gt;
    DisplayArrayList(&amp;quot;myArrayList&amp;quot;, myArrayList);&lt;br /&gt;
  }&lt;br /&gt;
  public static void DisplayArrayList(string arrayListName, ArrayList myArrayList)&lt;br /&gt;
  {&lt;br /&gt;
    for (int i = 0; i &amp;lt; myArrayList.Count; i++){&lt;br /&gt;
      Console.WriteLine(arrayListName + &amp;quot;[&amp;quot; + i + &amp;quot;] = &amp;quot; +&lt;br /&gt;
        myArrayList[i]);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==ArrayList.SetRange==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt; &lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
  public static void Main()&lt;br /&gt;
  {&lt;br /&gt;
    ArrayList myArrayList = new ArrayList();&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    string[] anotherStringArray = {&amp;quot;Here&amp;quot;s&amp;quot;, &amp;quot;some&amp;quot;, &amp;quot;more&amp;quot;, &amp;quot;text&amp;quot;};&lt;br /&gt;
    myArrayList.SetRange(0, anotherStringArray);&lt;br /&gt;
&lt;br /&gt;
    DisplayArrayList(&amp;quot;myArrayList&amp;quot;, myArrayList);&lt;br /&gt;
  }&lt;br /&gt;
  public static void DisplayArrayList(string arrayListName, ArrayList myArrayList)&lt;br /&gt;
  {&lt;br /&gt;
    for (int i = 0; i &amp;lt; myArrayList.Count; i++){&lt;br /&gt;
      Console.WriteLine(arrayListName + &amp;quot;[&amp;quot; + i + &amp;quot;] = &amp;quot; +&lt;br /&gt;
        myArrayList[i]);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==ArrayList.Sort()==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;  &lt;br /&gt;
/*&lt;br /&gt;
C#: The Complete Reference &lt;br /&gt;
by Herbert Schildt &lt;br /&gt;
Publisher: Osborne/McGraw-Hill (March 8, 2002)&lt;br /&gt;
ISBN: 0072134852&lt;br /&gt;
*/&lt;br /&gt;
// Sort and search an ArrayList. &lt;br /&gt;
 &lt;br /&gt;
using System; &lt;br /&gt;
using System.Collections; &lt;br /&gt;
 &lt;br /&gt;
public class SortSearchDemo { &lt;br /&gt;
  public static void Main() { &lt;br /&gt;
    // create an array list &lt;br /&gt;
    ArrayList al = new ArrayList(); &lt;br /&gt;
     &lt;br /&gt;
    // Add elements to the array list &lt;br /&gt;
    al.Add(55); &lt;br /&gt;
    al.Add(43); &lt;br /&gt;
    al.Add(-4); &lt;br /&gt;
    al.Add(88); &lt;br /&gt;
    al.Add(3); &lt;br /&gt;
    al.Add(19); &lt;br /&gt;
 &lt;br /&gt;
    Console.Write(&amp;quot;Original contents: &amp;quot;); &lt;br /&gt;
    foreach(int i in al) &lt;br /&gt;
      Console.Write(i + &amp;quot; &amp;quot;); &lt;br /&gt;
    Console.WriteLine(&amp;quot;\n&amp;quot;); &lt;br /&gt;
 &lt;br /&gt;
    // Sort &lt;br /&gt;
    al.Sort(); &lt;br /&gt;
 &lt;br /&gt;
    // Use foreach loop to display the list. &lt;br /&gt;
    Console.Write(&amp;quot;Contents after sorting: &amp;quot;); &lt;br /&gt;
    foreach(int i in al) &lt;br /&gt;
      Console.Write(i + &amp;quot; &amp;quot;); &lt;br /&gt;
    Console.WriteLine(&amp;quot;\n&amp;quot;); &lt;br /&gt;
 &lt;br /&gt;
    Console.WriteLine(&amp;quot;Index of 43 is &amp;quot; + &lt;br /&gt;
                      al.BinarySearch(43)); &lt;br /&gt;
  } &lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==ArrayList.Synchronized==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;  &lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
  static void Main(string[] args)&lt;br /&gt;
  {&lt;br /&gt;
    ArrayList a = new ArrayList(10);&lt;br /&gt;
    ArrayList.Synchronized(a);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==ArrayList.ToArray==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;  &lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
    public static void Main(string[] args)&lt;br /&gt;
    {&lt;br /&gt;
        // Create a new ArrayList and populate it.&lt;br /&gt;
        ArrayList list = new ArrayList(5);&lt;br /&gt;
        list.Add(&amp;quot;B&amp;quot;);&lt;br /&gt;
        list.Add(&amp;quot;G&amp;quot;);&lt;br /&gt;
        list.Add(&amp;quot;J&amp;quot;);&lt;br /&gt;
        list.Add(&amp;quot;S&amp;quot;);&lt;br /&gt;
        list.Add(&amp;quot;M&amp;quot;);&lt;br /&gt;
        object[] array2 = list.ToArray();&lt;br /&gt;
        Console.WriteLine(&amp;quot;Array 2:&amp;quot;);&lt;br /&gt;
        foreach (string s in array2) &lt;br /&gt;
        {&lt;br /&gt;
            Console.WriteLine(&amp;quot;\t{0}&amp;quot;, s);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==ArrayList.ToArray(typeof(T))==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt; &lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
    public static void Main(string[] args)&lt;br /&gt;
    {&lt;br /&gt;
        // Create a new ArrayList and populate it.&lt;br /&gt;
        ArrayList list = new ArrayList(5);&lt;br /&gt;
        list.Add(&amp;quot;B&amp;quot;);&lt;br /&gt;
        list.Add(&amp;quot;G&amp;quot;);&lt;br /&gt;
        list.Add(&amp;quot;J&amp;quot;);&lt;br /&gt;
        list.Add(&amp;quot;S&amp;quot;);&lt;br /&gt;
        list.Add(&amp;quot;M&amp;quot;);&lt;br /&gt;
        string[] array3 = (string[])list.ToArray(typeof(String));&lt;br /&gt;
        Console.WriteLine(&amp;quot;Array 3:&amp;quot;);&lt;br /&gt;
        foreach (string s in array3) &lt;br /&gt;
        {&lt;br /&gt;
            Console.WriteLine(&amp;quot;\t{0}&amp;quot;, s);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==ArrayList.TrimToSize()==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt; &lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
  public static void Main()&lt;br /&gt;
  {&lt;br /&gt;
    ArrayList myArrayList = new ArrayList();&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    string[] anotherStringArray = {&amp;quot;Here&amp;quot;s&amp;quot;, &amp;quot;some&amp;quot;, &amp;quot;more&amp;quot;, &amp;quot;text&amp;quot;};&lt;br /&gt;
    myArrayList.SetRange(0, anotherStringArray);&lt;br /&gt;
    myArrayList.TrimToSize();&lt;br /&gt;
    Console.WriteLine(&amp;quot;myArrayList.Capacity = &amp;quot; + myArrayList.Capacity);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==new ArrayList()==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;  &lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.Text;&lt;br /&gt;
class Program {&lt;br /&gt;
    static void Main(string[] args) {&lt;br /&gt;
        ArrayList baseballTeams = new ArrayList();&lt;br /&gt;
        baseballTeams.Add(&amp;quot;s&amp;quot;);&lt;br /&gt;
        baseballTeams.Add(&amp;quot;r&amp;quot;);&lt;br /&gt;
        baseballTeams.Add(&amp;quot;F&amp;quot;);&lt;br /&gt;
        foreach (string item in baseballTeams) {&lt;br /&gt;
            Console.Write(item + &amp;quot;\n&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==new ArrayList(Collection c)==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;  &lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
  public static void Main()&lt;br /&gt;
  {&lt;br /&gt;
    ArrayList myArrayList = new ArrayList();&lt;br /&gt;
    myArrayList.Add(&amp;quot;This&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;is&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;a&amp;quot;);&lt;br /&gt;
    myArrayList.Add(&amp;quot;test&amp;quot;);&lt;br /&gt;
    ArrayList anotherArrayList = new ArrayList(myArrayList);&lt;br /&gt;
    Console.WriteLine(anotherArrayList);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>