String a = new String ("Hello"); String b = new String ("Hello"); String x = a.intern(); String y = b.intern();
x=Hello, y=Hello x==y : true Objects.equals(x,y) : true x.equals(y) : true