Question 2 in Java test