Java Assignment 2