-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathQuestion1.java
More file actions
47 lines (38 loc) · 902 Bytes
/
Copy pathQuestion1.java
File metadata and controls
47 lines (38 loc) · 902 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
class MyExc1 extends Exception {}
class MyExc2 extends Exception {}
class MyExc3 extends MyExc2 {}
public class Question1 {
public static void main(String[] args) throws Exception {
try {
System.out.print(1);
q();
}
catch (Exception i) {
throw new MyExc2();
}
finally {
System.out.print(2);
throw new MyExc1();
}
}
static void q() throws Exception {
try {
throw new MyExc1();
}
catch (Exception y) {
}
finally {
System.out.print(3);
throw new Exception();
}
}
}
// Object o = null;
// int y = 0 ;
// try{
// double y = // age i would have got from aadhar card
//} catch(){}
// int avg = 50/y;
// o = avg;
// return o;
// NetworkException -> ArithmaticException -> NullPointerException