Assignment 1 for Java