Tagless
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import java.util.Scanner;
|
||||
|
||||
/**
|
||||
* ReverseString
|
||||
*/
|
||||
public class ReverseString {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
System.out.println(UserString());
|
||||
}
|
||||
|
||||
private static String UserString() {
|
||||
|
||||
Scanner sc = new Scanner(System.in);
|
||||
System.out.println("Please enter your input here: ");
|
||||
String userInput = sc.nextLine();
|
||||
|
||||
String revStr = "";
|
||||
for (int i = userInput.length() - 1; i >= 0; i--) {
|
||||
revStr += userInput.charAt(i);
|
||||
}
|
||||
return revStr;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user