Didart

Reverse String 2

Sep 29th, 2021
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.34 KB | None | 0 0
  1. package src;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class ReverseString {
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.        
  9.         String input = scanner.nextLine();
  10.  
  11.         StringBuilder builder = new StringBuilder(input);
  12.  
  13.         System.out.println(builder.reverse());
  14.     }
  15. }
  16.  
Advertisement
Add Comment
Please, Sign In to add comment