Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 949215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:22:13+00:00 2026-05-15T23:22:13+00:00

The method System.identityHashCode(…) is called that way, because it identifies objects, so two distinct

  • 0

The method System.identityHashCode(...) is called that way, because it identifies objects, so two distinct objects can’t have same identity-hashcode, right?

It returns an int. But what happens, on a system with huge amount of RAM, when the number of objects exceeds the integer range 2^32?

Wouldn’t it be a problem for HashMaps and HashSets when operating on classes which don’t override equals and hashCode?

EDIT:
If int is not enough, can I get some real unique ID for an object?

  • 1 1 Answer
  • 4 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T23:22:14+00:00Added an answer on May 15, 2026 at 11:22 pm

    No, it would just be a normal hash collision. Two unequal objects are allowed to return the same hash – it’s just that then both of them will need to be compared for equality.

    This isn’t restricted to identity hashcodes – consider String.hashCode(). Obviously there are more possible strings than int values, so there must be at least one hash value which is the result of hashing multiple strings. A HashMap/HashSet would first take the hash code to quickly narrow down the set of possible matches to only those entries which have the same hash code, and then call equals() on each one in turn until it found a match or determined that none of the entries was equal to the given key.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

System.Web.Mvc has an HtmlHelper that contains a method called EditorFor that renders the editing
The weird behavior is that a java.sql.Timestamp that I create using the System.currentTimeMillis() method,
Which method it is called on 3.ToString()? System.Int16.ToString() System.Int32.ToString() System.Int64.ToString()
I created an extension method called HasContentPermission on the System.Security.Principal.IIdentity : namespace System.Security.Principal {
Cannot call action method 'System.Web.Mvc.PartialViewResult FooT' on controller 'Controller' because the action method is
I have a web method: [System.Web.Services.WebMethod] public static string getCharacterstics(int product_id, int lang_id) {
I have a method which should return a list of anonymous objects with a
I have a WCF operation MyGetVersion() that returns a System.Version. When debugging a call
I have a controller called AuctionsController with a method public ActionResult BidsByAuction(int auctionId, int
I have created a table in the database that has a System.Guid as it's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.