This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
One little tidbit to add:Your problem, as stated above, is the semicolon. This closes the for statement, and you're simply looping str.length() times in an empty loop. At the end of the loop, i has the value str.length(), which is whygives you an ArrayIndexOutOfBoundsException (remember, arrays indexes go from 0 to array.length-1). - Peter