Code from the Head First Java Book