What's the quickest way to compare strings in Java?

后端 未结 7 2063
情话喂你
情话喂你 2020-12-06 04:42

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

7条回答
  •  春和景丽
    2020-12-06 04:59

    It depends what you need. I think equals() is really optimized but perhaps you need something else faster than equals(). Take a look at this post.

提交回复
热议问题