Create an object StringBuffer class to reverse the string.

Source Code:

public class StringBufferReverse {
public static void main(String[] args) {
StringBuffer sb = new StringBuffer(“welcome”);
sb.reverse();
System.out.println(sb);
}
}

Output: