Java practice and hw