Datasets:
ArXiv:
License:
Stack-Repo
/
data
/train
/akash-coded
/FSD_Java
/Lesson-3
/Exception Handling
/Examples
/FinallyExample3.java
| /** | |
| * Let's see the java finally example where exception occurs and handled. | |
| */ | |
| public class FinallyExample3 { | |
| public static void main(String args[]) { | |
| try { | |
| int data = 25 / 0; | |
| System.out.println(data); | |
| } catch (ArithmeticException e) { | |
| System.out.println(e); | |
| } finally { | |
| System.out.println("finally block is always executed"); | |
| } | |
| System.out.println("rest of the code..."); | |
| } | |
| } | |