Java Fundamentals homework