Java StringBuilder reverse() Method Example

Java StringBuilder reverse() method causes this character sequence to be replaced by the reverse of the sequence.

Java StringBuilder reverse() Method Example

Example to reverse the given String "javaguides" using reverse() method.
public class ReverseExample {
    public static void main(String[] args) {
        StringBuilder builder = new StringBuilder("javaguides");
        StringBuilder reverse = builder.reverse();
        System.out.println("Reversed string :" + reverse);
Reversed string :sediugavaj


Free Spring Boot Tutorial - 5 Hours Full Course

Watch this course on YouTube at Spring Boot Tutorial | Fee 5 Hours Full Course