Program to append the string using StringBuffer class

Source Code:

public class AppendString {
public static void main(String[] args) {
StringBuffer sb = new StringBuffer(“Hello”);
sb.append(” World”);
System.out.println(sb);
}
}

Output: