Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

reverse a string in java

public class StringReverseExample{
   public static void main(String[] args) {
      String string = "abcdef";
      String reverse = new StringBuffer(string).reverse().toString();
      System.out.println("
String before reverse: "+string);
      System.out.println("String after reverse: "+reverse);
   }
}
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #reverse #string #java
ADD COMMENT
Topic
Name
7+4 =