Capgemini interview question

reverse the string using java code