C# Tuple Equals
Description
Tuple Equals
returns a value that indicates
whether the current Tuple object is equal to a specified object.
Syntax
Tuple<T1, T2>.Equals
has the following syntax.
public override bool Equals(
Object obj
)
Parameters
Tuple<T1, T2>.Equals
has the following parameters.
obj
- The object to compare with this instance.
Returns
Tuple<T1, T2>.Equals
method returns true if the current
instance is equal to the specified object; otherwise,
false.
Example
The following example calls the Tuple<T1, T2>.Equals(Object) method to compare two tuples.
//ww w. j ava 2 s. com
using System;
public class Example
{
public static void Main()
{
Tuple<string, Nullable<int>> t1 = new Tuple<string, Nullable<int>>("A", 90);
Tuple<string, Nullable<int>> t2 = new Tuple<string, Nullable<int>>("B", 90);
Console.WriteLine(t1.Equals(t2));
}
}
The code above generates the following result.