Is there any reason why a Java string cannot be tested for equality using it's hashCode method? So basically, instead of....
"hello".equals("hello")
You could use...
"hello".hashCode() == "hello".hashCode()
This would be useful because once a string has calculated it's hashcode then comparing a string would be as efficient as comparing an int as the string caches the hashcode and it is quite likely that the string is in the string pool anyway, if you designed it that way.
See Question&Answers more detail:os