Thanks for all your replies.
I was trying to understand how String object gets created.
As mentioned in the K&B's book: "When the compiler encounters a String literal, it checks the pool to see if an identical String already exists. If a match is found, the reference to the new literal is directed to the existing String, and no new String literal object is created."
Actually, Rakesh's code gives: "a and b - same obj", which makes sense to me. However, I am still wondering in my code why z is not refering the existing "abc" in the pool.