Exercise on pg 43 of head first Java