Question: I have an arraylist with few duplicate items. I need to know the count of each duplicated item. I am using 2.0 so cannot use linq. 

I had posted a similar question earlier, but my question was not clear.
Thanks
Prady

Answer: 
I've done something in the past. My solution was to loop through the ArrayList and store the counts in a dictionary. Then loop though the dictionary to display the results:

```
        ArrayList list = new ArrayList();
        list.Add(1);
        list.Add("test");
        list.Add("test");
        list.Add("test");
        list.Add(2);
        list.Add(3);
        list.Add(2);

        Dictionary<Object, int> itemCount = new Dictionary<object, int>();

        foreach (object o in list)
        {
            if (itemCount.ContainsKey(o))
                itemCount[o]++;
            else
                itemCount.Add(o, 1);
        }

        foreach (KeyValuePair<Object, int> item in itemCount)
        {
            if (item.Value > 1)
                Console.WriteLine(item.Key + " count: " + item.Value);
        }

```

Output:

```
test count: 3
2 count: 2

```

**Edit**
Realized I used the var keyword which is not a 2.0 feature. Replaced it with KeyValuePair.
**Option 1**: Sort the list and then count adjacently Equal items (requires you to override the Equals method for your class)

**Option 2**: Use your unique identifier (however you're defining two objects to be equal) as the key for a Dictionary and add each of your objects to that entry.