String str = scan.nextLine();. scan.close();. /* Reverse string and compare to original */. String reversed = new StringBuilder(str).reverse().toString();. ... <看更多>
Reversing a string, accurately and efficiently. You are doing it accurately, yes. But, not very efficiently (although there are worse ways to do things). ... <看更多>