java - throw error out of the program -


inside code have several throw statements: throws ioexception, urisyntaxexception, interruptedexception etc.). every time there errors, program stops running , exits. how can catch errors without closing program?

you need implement try-catch block. imagine have method throws exception:

public void somemethod() throws exception {     throw new exception(); } 

to call method , handle exception, might this:

try {     somemethod(); } catch (exception e) {     // handle exception here } 

Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -