Capgemini Engineering interview question

Reverse a string in Java