This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
in terms of diagram we can have like this
System.out.println("in append method");//insert this line will make it more clear
System.out.println(sb1 + "," + sb2);
prints bb,bb(because value for duplicates is getting printed pattern)
but in original it will prints sb1=ab and sb2=bb..