Java Class Homework