Avatar of gudii9
Flag for United States of America

asked on 

Exception program

I am running program like below

public class Exceptions {
public static void main(String args[]) {
int i = 100;
int j = 0;
try {
int k = i / j;
} catch (java.lang.ArithmeticException ae) {
System.out.println("Arithmetic Exception handled");
System.out.println("Hello World");

I got output like

Arithmetic Exception handled
Hello World

I wonder why kw and kk not printed even though I caught the exception using catch block. Please advise
JavaJava EEJSP

Avatar of undefined
Last Comment

8/22/2022 - Mon