We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ded2956 commit 48f6034Copy full SHA for 48f6034
Day_30_ExceptionHandling/ExceptionHandling/FinallyExample.java
@@ -0,0 +1,12 @@
1
+public class FinallyExample {
2
+
3
+ public static void main(String[] args) {
4
+ try {
5
+ int result = 10 / 0; // This will throw an ArithmeticException
6
+ } catch (ArithmeticException e) {
7
+ System.out.println("Caught ArithmeticException: " + e.getMessage());
8
+ } finally {
9
+ System.out.println("This block always executes, regardless of exception.");
10
+ }
11
12
+}
0 commit comments