C# Decimal Equals(Object)
Description
Decimal Equals(Object)
returns a value indicating whether
this instance and a specified Object represent the same type and value.
Syntax
Decimal.Equals(Object)
has the following syntax.
public override bool Equals(
Object value
)
Parameters
Decimal.Equals(Object)
has the following parameters.
value
- The object to compare with this instance.
Returns
Decimal.Equals(Object)
method returns true if value is a Decimal and equal to this instance; otherwise, false.
Example
The following code shows how to use Decimal.Equals(Object)
method.
using System;/*from w ww .j a va 2s.c o m*/
class DecimalMulDivRemDemo
{
public static void Main( )
{
decimal d = 1000M;
Console.WriteLine(d.Equals((Object)7M) );
}
}
The code above generates the following result.