About 388,000 results
Open links in new tab
  1. Reverse a string in Java - Stack Overflow

    Sep 10, 2017 · StringBuffer buffer = new StringBuffer(str); System.out.println("StringBuffer - reverse : "+ buffer.reverse() ); String builderString = (new StringBuilder(str)).reverse().toString; …

  2. Reverse a String in Java - GeeksforGeeks

    Mar 27, 2025 · We can use character array to reverse a string. Follow Steps mentioned below: First, convert String to character array by using the built-in Java String class method …

  3. How To Reverse A String in Java - Software Testing Material

    Feb 13, 2025 · We can reverse a String in Java using the following ways. Let’s see one by one in detail. public static void main(String[] args) { // Using StringBuffer class. StringBuffer a = new …

  4. Reverse a String in Java - Shiksha Online

    Sep 18, 2023 · Apply recursion on an original string to reverse the string. Condition: if the string is null or length less than or equal to one, then return the original string. Else, print the last …

  5. Java 8 Program To Reverse a String - Java Guides

    Let's demonstrate how to reverse a string by converting it to a stream of characters, processing it with the Stream API, and then collecting the results into a string. Program Steps. 1. Convert …

  6. Java How To Reverse a String - W3Schools

    You can easily reverse a string by characters with the following example: reversedStr = originalStr.charAt(i) + reversedStr; } System.out.println("Reversed string: "+ reversedStr);

  7. How to Reverse A String In Java | Java Reverse Programs - Edureka

    Mar 14, 2023 · In this article, I will tell you the various approaches to Reverse a String in Java. 1. Reverse a String using CharAt Method. 2. Reverse a String using String Builder / String Buffer …

  8. Java Reverse String: Tutorial With Programming Examples

    Apr 1, 2025 · In this Tutorial, we will learn to Reverse a String in Java using the Reverse() Method of StringBuilder and StringBuffer Classes with the help of Examples.

  9. How to Reverse a String in Java: 9 Ways with Examples [Easy]

    This tutorial covers 9 methods for how to reverse a string in Java, including methods using built-in reverse functions, recursion, and a third-party library.

  10. java - Reverse string printing method - Stack Overflow

    Apr 13, 2021 · Write a method named printReverse that accepts a String as an argument and prints the characters in the opposite order. If the empty string is passed as an argument, the …

  11. Some results have been removed
Refresh