🌐
GeeksforGeeks
geeksforgeeks.org › java › stringbuffer-reverse-method-in-java
StringBuffer reverse() Method in Java with Examples - GeeksforGeeks
August 4, 2022 - The Java.lang.StringBuffer.reverse() is an inbuilt method that is used to reverse the characters in the StringBuffer.
🌐
Tutorialspoint
tutorialspoint.com › java › lang › stringbuffer_reverse.htm
Java StringBuffer reverse() Method
The Java StringBuffer reverse() method is used to reverse the characters of a StringBuffer object. It replaces the sequence of characters in reverse order. The method is a static method with predefined logic for reversing a string in Java.
🌐
Tutorialspoint
tutorialspoint.com › java › stringbuffer_reverse.htm
Java - String Buffer reverse() Method
This method reverses the value of the StringBuffer object that invoked the method. Let n be the length of the old character sequence, the one contained in the string buffer just prior to the execution of the reverse method.
🌐
IncludeHelp
includehelp.com › java-programs › java-program-to-demonstrate-example-of-string-reverse.aspx
How to reverse a string in Java with and without using StringBuffer.reverse() method?
import java.util.*; public class ReverseString { public static void main(String args[]) { //declare string object and assign string StringBuffer str= new StringBuffer("Hello World!"); //reverse the string str.reverse(); //print the reversed string System.out.println("String after reversing:" + str); } }
🌐
Oracle
docs.oracle.com › javase › 7 › docs › api › java › lang › StringBuffer.html
StringBuffer (Java Platform SE 7 )
public StringBuffer reverse() Causes this character sequence to be replaced by the reverse of the sequence. If there are any surrogate pairs included in the sequence, these are treated as single characters for the reverse operation. Thus, the order of the high-low surrogates is never reversed.
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › lang › StringBuffer.html
StringBuffer (Java Platform SE 8 )
April 21, 2026 - public StringBuffer reverse() Causes this character sequence to be replaced by the reverse of the sequence. If there are any surrogate pairs included in the sequence, these are treated as single characters for the reverse operation. Thus, the order of the high-low surrogates is never reversed.
🌐
Java67
java67.com › 2012 › 12 › how-to-reverse-string-in-java-stringbuffer-stringbuilder.html
How to Reverse String in Java with or without StringBuffer Example | Java67
There are many ways to reverse a given String in Java. For example, you can use rich Java API to quickly reverse the contents of any String object. Java library provides StringBuffer and StringBuilder class with the reverse() method which can be used to reverse String in Java.
🌐
Javatpoint
javatpoint.com › java-stringbuffer-reverse-method
Java StringBuffer reverse() Method with Examples - Javatpoint
Java StringBuffer reverse() Method with Examples on append(), capacity(), charAt(), delete(), indexOf(), getChars(), insert(), lastIndexOf(), length(), replace(), setCharAt(), setLength(), codePointAt(), codePointBefore(), codePointCount(), ensureCapacity() etc.
🌐
Java Tutorial HQ
javatutorialhq.com › java tutorial › java.lang › stringbuffer › reverse() method example
Java StringBuffer reverse() method example
September 30, 2019 - package com.javatutorialhq.java.examples; /* * This example source code demonstrates the use of * reverse() method of StringBuffer class */ public class StringBufferReverse { public static void main(String[] args) { // initialize the StringBuffer object StringBuffer sb = new StringBuffer("javatutorialhq.com"); System.out.println("Contents of buffer:" + sb); //reverse the character sequence sb.reverse(); System.out.println("New contents of string buffer:" + sb); } }
🌐
Java Guides
javaguides.net › 2024 › 06 › java-stringbuffer-reverse-method.html
Java StringBuffer reverse() Method
June 10, 2024 - The StringBuffer.reverse() method in Java is used to reverse the sequence of characters in a StringBuffer object.
Find elsewhere
🌐
GeeksforGeeks
geeksforgeeks.org › java › reverse-a-string-in-java
Reverse a String in Java - GeeksforGeeks
Explanation: Characters are stored in a list and reversed using Collections.reverse(). This approach is helpful when you’re already working with Java collections. StringBuffer is similar to StringBuilder but thread-safe.
Published   May 12, 2026
🌐
YouTube
youtube.com › talented developer
Java Program to reverse a String Using StringBuffer with Explanation - YouTube
#javatutorialforbeginners #javaprogrammingJava Program to reverse a String Using StringBuffer with explanationAll Java Programs | Java Coding Interview Quest...
Published   May 16, 2022
🌐
Software Testing Help
softwaretestinghelp.com › home › java › java reverse string: tutorial with programming examples
Java Reverse String: Tutorial With Programming Examples
April 1, 2025 - Answer: No. The String class does not have a reverse() method. However, you can reverse a String using multiple ways in the String class itself. Also, StringBuilder, StringBuffer, and Collections support the reverse() method.
🌐
Medium
medium.com › womenintechnology › 3-ways-to-reversing-string-in-java-b40a23bbcc6c
3 ways to Reversing String In JAVA | by Daily Debug | Women in Technology | Medium
August 10, 2023 - This is the traditional way of reversing a string in which we traverse through the array backwards. ... char [] strCharArray = str.toCharArray() ; StringBuffer revr = new StringBuffer(); for(int i=strCharArray.length-1;i>-1;i--){ revr.appen...
🌐
Oracle
docs.oracle.com › en › java › javase › 15 › docs › api › java.base › java › lang › StringBuffer.html
StringBuffer (Java SE 15 & JDK 15)
public StringBuffer reverse() Causes this character sequence to be replaced by the reverse of the sequence. If there are any surrogate pairs included in the sequence, these are treated as single characters for the reverse operation. Thus, the order of the high-low surrogates is never reversed.
🌐
Oracle
docs.oracle.com › javase › 6 › docs › api › java › lang › StringBuffer.html
StringBuffer (Java Platform SE 6)
public StringBuffer reverse() Causes this character sequence to be replaced by the reverse of the sequence. If there are any surrogate pairs included in the sequence, these are treated as single characters for the reverse operation. Thus, the order of the high-low surrogates is never reversed.
🌐
YouTube
youtube.com › codeash
StringBuffer reverse() Method in Java | How to reverse a sentence using StringBuffer in Java? - YouTube
🔰 StringBuffer reverse() Method :Java StringBuffer reverse() method. The reverse() method of Java StringBuffer class is used to replace this character seque...
Published   October 7, 2023
Views   32
🌐
Oracle
docs.oracle.com › javase › 10 › docs › api › java › lang › StringBuffer.html
StringBuffer (Java SE 10 & JDK 10 )
public StringBuffer reverse() Causes this character sequence to be replaced by the reverse of the sequence. If there are any surrogate pairs included in the sequence, these are treated as single characters for the reverse operation. Thus, the order of the high-low surrogates is never reversed.