problem 24 java