publicclass JAVA_058
{
publicstaticvoid main(String[] args)
{
StringBuffer SB1=new StringBuffer("A switch in time");
StringBuffer SB2=new StringBuffer(" saves nine");
System.out.println("StringBuffer # 1 : " + SB1);
System.out.println("StringBuffer # 2 : " + SB2);
SB1.append(SB2);
System.out.println("\nStringBuffer # 1 : " + SB1);
System.out.println("StringBuffer # 2 : " + SB2);
StringBuffer SB3=new StringBuffer( );
SB3.append("\nStringBuffer # 3 : ").append(SB1).append(". \n");
System.out.println(SB3);
StringBuffer SB4=new StringBuffer("The number is ");
long number=999;
SB4.append(number);
SB4.append(12.34);
char[] cArray={'i','s',' ','e','x','a','c','t','l','y'};
SB4.append(cArray,2,8);
System.out.println("StringBuffer # 4 : " + SB4);
}
}