C# Queue Equals(Object)

Description

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

Syntax

Queue.Equals(Object) has the following syntax.


public virtual bool Equals(
  Object obj
)

Parameters

Queue.Equals(Object) has the following parameters.

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

Returns

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

Example


/*w  w  w .ja  v  a 2 s.c  om*/
using System;
using System.Collections;
public class SamplesQueue  {

   public static void Main()  {
      Queue myQ = new Queue();
      myQ.Enqueue( "1" );
      myQ.Enqueue( "2" );
      myQ.Enqueue( "3" );
      myQ.Enqueue( "4" );
      myQ.Enqueue( "5" );

      myQ.Clear();

      Console.WriteLine(myQ.Equals((Object)myQ) );
   }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Collections »




ArrayList
BitArray
Comparer
Hashtable
Queue
SortedList
Stack