CS 61B project1 in java