problem 7 java