answer re: How do I compare strings in Java?
Feb 4 ’09
5553
==
tests for reference equality (whether they are the same object).
.equals()
tests for value equality (whether they are logically “equal”).
Objects.equals() checks for null
before calling .equals()
so you don’t have to (available as of JDK7, also available in Guava).
Consequently, if you want to test whether two…
© 版权声明
THE END
暂无评论内容