Java final exam questions 2