summaryrefslogtreecommitdiff
path: root/java/11-error-handling-1/ErrorHandlingExample1.java
blob: 0dc027680c9dec6008f00ce1e29748c0a93703c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
public class ErrorHandlingExample1 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		int x = 2;
		int y = 0;
		int z = 0;

//		try {
		    z = x / y;
//		} catch (ArithmeticException ae) {
//			System.out.println("An error occurred");
//		}
		
		System.out.println(z);
	}

}