Showing posts with label catch. Show all posts
Showing posts with label catch. Show all posts

Wednesday, 22 January 2014

USING try AND catch

How to use exception handling keywords try and catch in java

THE try BLOCK


A try statement is used to catch exceptions that might be thrown as your program executes. You should use a try statement whenever you use a statement that might throw an exception,That way,your program won’t crash if the exception occurs.The first step in constructing an exception handler is to enclose the code that might throw an exception within a try block. 

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.