What’s the quickest to compare two strings in Java?
Is there something faster than equals?
EDIT:
I can not help much to clarify the problem.
I have two String which are sorted alphabetically and EXACTLY the same size
Example: abbcee and abcdee
Strings can be long up to 30 characters
I don’t expect that
SunOracle hasn’t already optimized the standardString#equals()to the max. So, I expect it to be already the quickest way. Peek a bit round in its source if you want to learn how they implemented it. Here’s an extract: