C# Int64 Equals(Int64)

Description

Int64 Equals(Int64) returns a value indicating whether this instance is equal to a specified Int64 value.

Syntax

Int64.Equals(Int64) has the following syntax.


public bool Equals(
  long obj
)

Parameters

Int64.Equals(Int64) has the following parameters.

  • obj - An Int64 value to compare to this instance.

Returns

Int64.Equals(Int64) method returns true if obj has the same value as this instance; otherwise, false.

Example

The following code example demonstrates the Equals method.


using System;//  w  w  w .j a v  a2 s. co  m

class Sample 
{
    public static void Main() 
    {
        Int64    e1 = 4,     e2 = -4;
        Console.WriteLine(e1.Equals(e2));
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version