java code for error ask and prompt