java: problem 2