Datasets:

ArXiv:
License:
File size: 517 Bytes
c574d3a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
public class ThrowsDemo {
    void division() throws ArithmeticException {
        int a = 45;
        int b = 0;
        int rs;
        rs = a / b;
        System.out.print("\n\tThe result is : " + rs);
    }

    public static void main(String[] args) {
        ThrowsDemo obj = new ThrowsDemo();
        try {
            obj.division();
        } catch (ArithmeticException ex) {
            System.out.print("\n\tError : " + ex.getMessage());
        }
        System.out.print("\n\tEnd of program.");
    }

}