Java Homework 2