Apexon interview question

String reversal program in java