Hmmmm. I was thinking the answer will be B After r = r+1; //Doesn't it return a new object (Stringbuffer.append().toString())?? String r = new String("abc"); and r = r+1; // different 'r' and different hashcode Can some one clarify this for me? Thankx Ragu

Fei Ng
Ranch Hand

Joined: Aug 26, 2000
Posts: 1242

posted Nov 04, 2001 19:25:00

0

The question is asking about the reference s. Not r. r = new String("abc"); s = new String("abc"); not the same String object. Not from a pool... like this r = "abc"; s = "abc"; They are the same this way.