C# Version Equals(Object)

Description

Version Equals(Object) returns a value indicating whether the current Version object is equal to a specified object.

Syntax

Version.Equals(Object) has the following syntax.


public override bool Equals(
  Object obj
)

Parameters

Version.Equals(Object) has the following parameters.

  • obj - An object to compare with the current Version object, or null.

Returns

Version.Equals(Object) method returns true if the current Version object and obj are both Version objects, and every component of the current Version object matches the corresponding component of obj; otherwise, false.

Example


/*w  w  w  . j  a v a 2 s.c om*/
using System;

class Sample 
{
    public static void Main() 
    {
        Version interim = new Version(1,2,3,4);
        Version interim1 = new Version(1,2,4,4);
    
        Console.WriteLine(interim.Equals((Object)interim1));
    }
}

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