CS 61B project2 in java