Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • This has all markings of an XY problem. What is the real problem you're trying to solve, and not the one you actually asked? Commented Apr 28, 2015 at 10:58
  • The real problem is the one i asked. In the formula given in Java API i dont know what value s[0] or s[1] should be. If i read from the formula - the s[0] should give me the value 1. Commented Apr 28, 2015 at 11:02
  • No, that's not your real problem. There is no reasonable "real problem" that involves the internal workings of Java's hashcode calculations. You must be trying to solve some other problem, and you think that messing around with hashcode formulas is the asnwer. It's not. Commented Apr 28, 2015 at 11:04
  • My task is to find the hashCode to the String "ab" by only reading the JAVA API and use the formula provided. Then i should test it and see if i got the answer right. Commented Apr 28, 2015 at 11:06
  • I would assume it holds the first character of the string you are passing, ie. the a from your ab string. Commented Apr 28, 2015 at 11:22