java Assignment 2