Skip to content

Commit 371987d

Browse files
authored
Create Exception.java
1 parent b2014d5 commit 371987d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Exception.java

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
public class Exception
2+
{
3+
public static void main(String args[])
4+
{
5+
try
6+
{
7+
int data=100/0;
8+
}
9+
catch(ArithmeticException e)
10+
{
11+
System.out.println(e);
12+
}
13+
System.out.println("Done!");
14+
}
15+
}
16+
17+
18+
//####### Output ##################
19+
20+
java.lang.ArithmeticException: / by zero
21+
Done!

0 commit comments

Comments
 (0)