C# Stack Equals(Object)

Description

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

Syntax

Stack.Equals(Object) has the following syntax.


public virtual bool Equals(
  Object obj
)

Parameters

Stack.Equals(Object) has the following parameters.

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

Returns

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

Example


using System;//from  w ww  .  ja v a2 s . com
using System.Collections;
public class SamplesStack  {

    public static void Main()  {
       Stack mySourceQ = new Stack();
       mySourceQ.Push( "A" );
       mySourceQ.Push( "B" );
       mySourceQ.Push( "C" );

       Console.WriteLine(mySourceQ.Equals(mySourceQ) );

    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Collections »




ArrayList
BitArray
Comparer
Hashtable
Queue
SortedList
Stack