結果 : 2 write java code to reverse a string while preserving the whitespace