I have written this code in eclipse:
String[] s = {"a","b"};
String d = "a";
System.out.println(s[0]==d);
and it is giving "true" as output.
"==" checks for object reference, if both object refer to same object, but here in this case object "d" refers to different object and "s[0]" to different, then how come they are equal.