forked from MURFYEXP/algorithms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReturnTest.java
More file actions
37 lines (32 loc) · 756 Bytes
/
ReturnTest.java
File metadata and controls
37 lines (32 loc) · 756 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
package zzzTest;
/**
* Created by nibnait on 2016/9/20.
*/
public class ReturnTest {
public static void main(String[] args) {
System.out.println(getNumber(0));
System.out.println(getNumber(1));
System.out.println(getNumber(2));
System.out.println(getNumber(4));
// System.out.println(getValue());
}
private static int getNumber(int num) {
int result = Integer.MAX_VALUE;
try{
result = 2/num;
} catch (Exception e){
return 0;
}
// return result;
finally {
return -1;
}
}
public static int getValue() {
try{
return 0;
} finally {
return 1;
}
}
}