MCPcopy Create free account
hub / github.com/PrajaktaSathe/Java / main

Method main

Programs/arithExceptions.java:3–20  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

1// Program to show ArithmeticException Error handling -
2public class arithExceptions {
3 public static void main(String[] args) {
4 // try block -
5 try {
6 int a = 20, b;
7 b = a/0;
8 System.out.println("Value of b = " + b);
9 }
10 // catch block -
11 catch(ArithmeticException e) {
12 System.out.println("Exception occured!");
13 }
14 // finally block -
15 finally {
16 System.out.println("Quit");
17 System.out.println("This block will always execute!");
18 }
19 // finally block can be used to catch any exception
20 }
21}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected