import java.lang.*;
public class AppendInsert{
public static void main(String[] args) {
System.out.println("StringBuffer insert and append example!");
StringBuffer sb = new StringBuffer(0);
//First position
System.out.println(sb.insert(0, "Raj"));
int len = sb.length();
//last position
System.out.println(sb.insert(len, "Deepak"));
//Six position
System.out.println(sb.insert(6, "kumar"));
//Always last
System.out.println(sb.append("Mohit"));
}
}Here am going to explain about the Append and Insert program in JAVA. It will be displayed in the Run mode.
