*5.46(倒排一个字符串)编写一个程序,提示用户输入一个字符串,然后以反序显示该字符串。
Enter a string: ABCD
The reversed string is DCBA
*5.46(Reverse a string) Write a program that prompts the user to enter a string and displays the string in reverse order.
Enter a string: ABCD
The reversed string is DCBA
下面是参考答案代码:
import java.util.Scanner;
public class ReverseAStringQuestion46 {
public static void main(String