complete ex.7 java