1.) newString gets re-created every iteration of the loop, so it always contains a single character, and at the end of the loop it contains the first character of the string. 2.) Strings are immutable (in Java), so "newString = newString + x" creates a new object on every iteration. Better to use a StringBuffer and swap the ith and N - i - 1th characters of the string.