Recent Posts
- NCC Punjab LDC Results 2013 NCCPunjab.com Interview Selected Candidates List
- RGUHS PGSSET Super Speciality 2013 Exam www.logisys.net.in Online Application
- RKCL RS-CIT Results 2013 rkcl.in RSCIT Final Exam May Result 2013
- TNEB Electricity Bills Online Payment tnebnet.org/awp/login Tamilnadu EB Payment System
- Kerala LET 2013 Fee Structure for 2013-14 Engineering College Admission
Discussion Forum
Multiple Catch Blocks in Java Example Program – Exception Handling
You can find Multiple Catch Blocks in Java Example Program.The concept of Exception Handling multiple catch blocks.
You can find Multiple Catch Blocks in Java Example Program.The concept of Exception Handling multiple catch blocks.
public class MultipleCatchDemo {
public static void main(String args[]) {
try {
int num1 = 24;
int num2 = 0;
System.out.println(“\nIn try block trying to devide…”);
int result = num1 / num2;
System.out.println(“\n\nResult of division: ” + result);
} catch(ArithmeticException e1) {
System.out.println(e1);
} catch(Exception e){
System.out.println(“\n\nException: ” + e);
}
finally {
System.out.println(“\n\nIn the finally block…”);
}
System.out.println(“\n\n”);
}
}
Result:
In try block trying to devide…
java.lang.ArithmeticException: / by zero
In the finally block…
