Java version of HW 4 on Objects.