Java Assignment 3