public class TestStringBuffer{
public static void main(String args[]){
StringBuffer s1=new StringBuffer();
StringBuffer s2=new StringBuffer(15);
StringBuffer s3=new StringBuffer(“How are you”);
char array[]=new char[25];
s1.append(“do you come here?”);
s2.append(“when?”);
s1.getChars(2,s1.length()-2,array,0);
System.out.println(array);
for(int i=0,j=0;i<array.length;i++)
if (array[i]>’e’)
s2.insert(j++,array[i]);
s3.setCharAt(1,’d’);
System.out.println(s1);
System.out.println(s2);
System.out.println(s3);
}
}
public static void main(String args[]){
StringBuffer s1=new StringBuffer();
StringBuffer s2=new StringBuffer(15);
StringBuffer s3=new StringBuffer(“How are you”);
char array[]=new char[25];
s1.append(“do you come here?”);
s2.append(“when?”);
s1.getChars(2,s1.length()-2,array,0);
System.out.println(array);
for(int i=0,j=0;i<array.length;i++)
if (array[i]>’e’)
s2.insert(j++,array[i]);
s3.setCharAt(1,’d’);
System.out.println(s1);
System.out.println(s2);
System.out.println(s3);
}
}
you come her
do you come here?
youomhrwhen?
Hdw are you