hi....every one!! the thing is that whether you use "replace"....or not doesnt matter because the == works on same memeory check.....i.e it can b used for a single objects variables. even this is wrong; String str="hi"; String ttt="hi"; if(str==ttt) //if wont come here ..... reason is different objects thats it..!! every where they will be treated as different objects!! use.. object.equalto(object); it will return true..!!