C# TypeInfo Equals(Object)

Description

TypeInfo Equals(Object) Determines if the underlying system type of the current Type is the same as the underlying system type of the specified Object.

Syntax

TypeInfo.Equals(Object) has the following syntax.


public override bool Equals(
  Object o
)

Parameters

TypeInfo.Equals(Object) has the following parameters.

  • o - The object whose underlying system type is to be compared with the underlying system type of the current Type.

Returns

TypeInfo.Equals(Object) method returns true if the underlying system type of o is the same as the underlying system type of the current Type; otherwise, false. This method also returns false if the object specified by the o parameter is not a Type.

Example


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

class Example
{
    public static void Main()
    {

        Type a = typeof(System.Object);
        Type b = typeof(System.Object);

        Console.WriteLine("{0} == {1}: {2}", a, b, a.Equals(b));

    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Reflection »




EventInfo
FieldInfo
MemberInfo
MethodInfo
ParameterInfo
TypeInfo