Cognizant interview question

reverse a string in java