public static void reverseString(char[] s) { for(int i = 0;i < s.length/2; i++){ char a; a = s[i]; s[i] = s[s.length-1-i]; s[s.length-i-1] = a; } }