Mega Code Archive

 
Categories / Java / Data Type
 

Reverse a string

public class Main {   public static void main(String[] args) {     String words = "Morning";     String reverse = new StringBuffer(words).reverse().toString();     System.out.println("Normal : " + words);     System.out.println("Reverse: " + reverse);   } }