GetHashCode

  • Thread starter Thread starter Andrew
  • Start date Start date
A

Andrew

Why was the GetHashCode operation given the lofty status
of being carried out by a member of the Object class?
 
Andrew said:
Why was the GetHashCode operation given the lofty status
of being carried out by a member of the Object class?

So that *any* object can be added to a Hashtable.
 
Well yes, it does do that. That is not really what I was
asking, though. Let me try to clarify. There are lots of
operations X such that it might be nice to perform X on
any object. But only a few of them actually make it into
the Object class. Why did GetHashCode make it?
 
Back
Top