Is Java's assertEquals method reliable?

前端 未结 7 1727
[愿得一人]
[愿得一人] 2020-11-29 18:05

I know that == has some issues when comparing two Strings. It seems that String.equals() is a better approach. Well, I\'m doing JUni

7条回答
  •  执笔经年
    2020-11-29 18:32

    "The == operator checks to see if two Objects are exactly the same Object."

    http://leepoint.net/notes-java/data/strings/12stringcomparison.html

    String is an Object in java, so it falls into that category of comparison rules.

提交回复
热议问题