C# SortedList Equals(Object)

Description

SortedList Equals(Object) determines whether the specified object is equal to the current object.

Syntax

SortedList.Equals(Object) has the following syntax.


public virtual bool Equals(
  Object obj
)

Parameters

SortedList.Equals(Object) has the following parameters.

  • obj - The object to compare with the current object.

Returns

SortedList.Equals(Object) method returns true if the specified object is equal to the current object; otherwise, false.

Example


using System; //from w  ww. j  a v a 2 s.  c o  m
using System.Collections; 
 
class MainClass { 
  public static void Main() { 
    SortedList sl = new SortedList(); 
     
    sl.Add("a", "A"); 
    sl.Add("b", "B"); 
    sl.Add("c", "C"); 
    sl.Add("d", "D"); 
 
    Console.WriteLine(sl.Equals(sl));
  }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Collections »




ArrayList
BitArray
Comparer
Hashtable
Queue
SortedList
Stack