You are viewing a single comment's thread. Return to all comments →
try{ int num1 = sc.nextInt(); int num2 = sc.nextInt(); System.out.println(num1/num2); }catch (InputMismatchException e) { System.out.println(e.getClass().getName()); } catch (ArithmeticException e) { System.out.println(e); }
Java Exception Handling (Try-catch)
You are viewing a single comment's thread. Return to all comments →