Showing posts with label throw. Show all posts
Showing posts with label throw. Show all posts

Thursday, 23 January 2014

throw EXCEPTIONS IN JAVA

Java:Using throw


When to use throw in a Java method declaration?

All methods use the throw statement to throw an exception. The throw statement requires a single argument: a Throwable object. Throwable object are instances of any subclass of the Throwable classThe flow of execution stops immediately after the throw statement;any subsequent statements are not executed.

Wednesday, 22 January 2014

EXCEPTION HANDLING IN JAVA

how to use exception handling

Exception-Handling Fundamentals

An exception is an abnormal condition that arises in a code sequence at run time. In other words, an exception is a run-time error.When an exceptional condition arises, an object representing that exception is created and thrown in the method that caused the error.That method may choose to handle the exception itself, or pass it on. Either way, at some point, the exception is caught and processed.