class X
{
public static void main(String...a)
{
String a = "meow";
String ab = a + "deal";
String abc = "meowdeal";
System.out.println(ab == abc);
}
}
Am getting an output as false... why. Am preparing for ocjp. I thin we have to get true. Beacuse ab contains "meowdeal". When am trying to assign "meowdeal" to abc this literal is already tehre in string pool. So ab and abc both are pointing to the same object. Then we have to get true.