Exceptions and exception handling

suggest change


Objects of type Throwable and its subtypes can be sent up the stack with the throw keyword and caught with try…catch statements.


someMethod(); //code that might throw an exception


System.out.println("SomeException was thrown!"); //code that will run if certain exception (SomeException) is thrown
//code that will always run, whether try block finishes or not

Feedback about page:

Optional: your email if you want me to get back to you:

Table Of Contents