What is exception in Java ? explain try and catch in Java ?

October 28, 2007 · Filed Under Java SE Interview questions, Placement Questions 



Don't want to miss a single bit? Subscribe By Email for Daily Jobs

Enter your email address :

All the latest from JobsAdda on Jobsadda.com delivered to your mailbox everyday.

Exception is language feature which allows easy handling of errors.

Try catch is error handling routine using exceptions. Try block indicates that exception may occur in that part of code and catch block provides handling of it.

try {
// Code that might generate exceptions
} catch(Type1 id1) {
// Handle exceptions of Type1
} catch(Type2 id2) {
// Handle exceptions of Type2
} catch(Type3 id3) {
// Handle exceptions of Type3
}

// etc…

Related Articles


Get Latest JobsAdda.com Jobs, news & updates  via Email