Compare two ArrayList for equal in CSharp

Description

The following code shows how to compare two ArrayList for equal.

Example


using System;//ww w  . j  a  va2  s .  co  m
using System.Collections;

class MainClass
{
  static void Main(string[] args)
  {
    ArrayList a = new ArrayList(10);
    a.Add(0);

        ArrayList b = new ArrayList(10);
        
        Console.WriteLine(a.Equals(b));
  }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    Collections »




ArrayList
BitArray
Collection
Comparer
HashSet
Hashtable
LinkedList
List
ListDictionary
OrderedDictionary
Queue
SortedList
SortedSet
Stack
StringCollection
StringDictionary