This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Rene Larsen wrote:You need to have two variables - one that count down (x -> 0) and one counting up (0 -> x)
That or use a calculation for one of the two array accesses. Like s1.length() - 1 - i. The two variables would be easier though.
Nelson, one hint: instead of using "new char", use "new char[s1.length()]". That will a) allow you to use strings larger than 26 characters, and b) not take up space for 26 characters if fewer (e.g. 5) are needed.