C# Decimal GetHashCode

Description

Decimal GetHashCode returns the hash code for this instance.

Syntax

Decimal.GetHashCode has the following syntax.


public override int GetHashCode()

Returns

Decimal.GetHashCode method returns A 32-bit signed integer hash code.

Example

Example of the decimal.GetHashCode method.


/*from  w  w w. j  ava  2  s . c o  m*/
using System;

class DecimalGetHashCodeDemo{
    public static void Main( )
    {
        decimal d = 1M;
        Console.WriteLine(d.GetHashCode());
    }
}

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