This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
hi, the StringBuffer class does not override the default equals() methods.so it checks for equality of references,which are always different for newly created object. so ur if condition just checks whether sb1==sb2 which is false.hope this helps
~naren<br /> scjp1.4<br /> scwcd1.4
Joined: Aug 03, 2002
Take a look at StringBuffer's API. Look for the equals method...