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 0e136d6 commit b5e1bc1Copy full SHA for b5e1bc1
exception_prpogation.java
@@ -1,22 +1,30 @@
1
-public class exception_prpogation {
2
- void fun1(){
+public class exception_prpogation
+{
3
+ void fun1()
4
+ {
5
int data=50/0; //exception occurs
6
}
7
//exception prpogated to fun2()
- void fun2(){
8
+ void fun2()
9
10
fun1(); //exception not handled
11
//exception propogated to fun3()
12
- void fun3(){
- try{
13
+ void fun3()
14
15
+ try
16
17
fun2();//exception handled
18
- catch(Exception e){System.out.println("Exception handled");
- }}
- public static void main(String args[]){
19
+ catch(Exception e)
20
21
+ System.out.println("Exception handled");
22
+ }
23
24
+ public static void main(String args[])
25
26
exception_prpogation obj =new exception_prpogation();
27
obj.fun3();
28
System.out.println("rest of the code");
- }
-
29
30
0 commit comments