class Reverse { // Complete the function // str: input string public static String reverseWord(String str) { // Reverse the string str int n = str.length(); char ch[] = str.toCharArray(); for(int i = 0; i<n/2; i++) { char t = ch[i]; ch[i] = ch[n-i-1]; ch[n-i-1]=t; } return new String(ch); } }