File size: 471 Bytes
c574d3a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
/**
* Let's see the java finally example where exception doesn't occur.
*/
public class FinallyExample1 {
public static void main(String args[]) {
try {
int data = 25 / 5;
System.out.println(data);
} catch (NullPointerException e) {
System.out.println(e);
} finally {
System.out.println("finally block is always executed");
}
System.out.println("rest of the code...");
}
}
|