This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
and readLine() returns "" (the empty String) then yes, charAt() will throw a StringIndexOutOfBoundsException, as there is no 0th character in an empty String. Note also that at end-of-file, readLine() returns null, and you need to watch for that as well. Better to write something like