-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOurThrowDefaultOurException.java
More file actions
47 lines (44 loc) · 1.01 KB
/
Copy pathOurThrowDefaultOurException.java
File metadata and controls
47 lines (44 loc) · 1.01 KB
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
44
45
46
47
public class OurThrowDefaultOurException
{
public static void main(String[] args)
{
int balance = 5000;
int withdrawAmount = 6000;
try
{
if(balance < withdrawAmount)
throw new ArithmeticException("Balance is low!");
}
catch(Exception e)
{
System.out.println("Catched Exception : " + e.getMessage());
}
finally
{
System.out.println("Finally");
}
}
}
/*
public class OurThrowDefaultOurException
{
public static void main(String[] args)
{
int balance = 5000;
int withdrawAmount = 6000;
try
{
if(balance < withdrawAmount)
throw new ArithmeticException("Balance is low!");
}
// catch(Exception e)
// {
// System.out.println("Catched Exception : " + e.getMessage());
// }
finally
{
System.out.println("Finally");
}
}
}
*/