그래서 ==는 참조 번호 (메모리에있는 객체의 주소)에서 동등성을 검사한다는 것을 이해합니다. 그리고 .equals()는 객체의 내용을 검사합니다.== 대. equals를 사용하여 자바의 문자열을 비교
String s = "test";
String s2 = "test";
나는 두 개의 서로 다른 문자열 개체를 만드는거야 아직, 나는 다음과 같은 얻을 :
s == s2; //true, I dont know why, aren't s and s2 two different objects with
different internal values
s.equals(s2); //true, which I understand
이것은 [this thread] (http://stackoverflow.com/questions/513832/how-do-i-compare-strings-in-java)에 자세히 설명되어 있습니다. – eis