JAVA
java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
public class catchDivideByInfException
{
public static void main(String[] args) {
int a = 2;
int b = 0;
try {
int c = a / b;
System.out.println(c);
}
catch (Exception e) {
System.out.println("e");
}
}
}
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run