GetHashCode method and the key of Dictionary

  • Thread starter Thread starter Jeff0803
  • Start date Start date
J

Jeff0803

Guest
Through override GetHashCode method, I can get the unique code of object.

If a Dictionary is Dicttionary<string, Message> and Message is a class I made, then I can use the return value of GetHashCode method of the Message class.

However, even though I don't use GetHashCode, I can make unique key directly without using GetHashCode.

Is there any advantage to use GetHashCode method?

Continue reading...
 
Back
Top