以下の私のコード
public class EqualsComMetod_Operator {
public static void main(String[] args) {
String s1=new String("Raja");
String s2=new String("Raja");
System.out.println("s1==s2::"+s1==s2);
// Here the text s1==s2:: not printed on my console why??
}
}
出力:
間違い
オブジェクトを参照/アドレスとして比較し、次のように印刷しようとしています:
s1==s2::偽
しかし、直接偽を示しています。なんで?