C# Exception GetHashCode

In this chapter you will learn:

  1. Get to know Exception.GetHashCode
  2. Syntax for Exception.GetHashCode
  3. Returns for Exception.GetHashCode
  4. Example - Exception.GetHashCode

Description

Exception GetHashCode serves as the default hash function.

Syntax

Exception.GetHashCode has the following syntax.


public virtual int GetHashCode()

Returns

Exception.GetHashCode method returns A hash code for the current object.

Example


using System;//from   w  w w . j av a2 s.co m
public class MainClass{
  public static void Main(String[] argv){  
    Exception e = new Exception("asdf")
    
    System.Console.WriteLine(e.GetHashCode());
  }
}

Next chapter...

What you will learn in the next chapter:

  1. Get to know Exception.GetType
  2. Syntax for Exception.GetType
  3. Returns for Exception.GetType
  4. Example - Exception.GetType
Home »
  C# Tutorial »
    System »
      Exception
C# Exception Data
C# Exception HelpLink
C# Exception InnerException
C# Exception Message
C# Exception Source
C# Exception StackTrace
C# Exception TargetSite
C# Exception Exception()
C# Exception Exception(String)
C# Exception Exception(String, Exception)
C# Exception Equals(Object)
C# Exception Finalize
C# Exception GetBaseException
C# Exception GetHashCode
C# Exception GetType
C# Exception MemberwiseClone
C# Exception ToString