import java.util.Scanner; public class MyStack { public static void main(String[] args) { // TODO Auto-generated method stub Scanner scanner = new Scanner(System.in); String string = scanner.nextLine(); String output = ""; StringBuilder stringBuilder = new StringBuilder(); output = stringBuilder.append(string).reverse().toString(); System.out.println(output); } }
Reverse a string in java
Here in this section I'll put solution of some simple programming problem which. The following one will reverse a string.
0 comments:
Post a Comment