From e443a241cc7e411ccbebf0a9d2dfe3951f9ab33a Mon Sep 17 00:00:00 2001 From: Dhruv kalra <81011668+Vipdhruvkalra@users.noreply.github.com> Date: Sat, 8 Oct 2022 21:01:47 +0530 Subject: [PATCH] Create Exceptionhandling.java --- Exceptionhandling.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Exceptionhandling.java diff --git a/Exceptionhandling.java b/Exceptionhandling.java new file mode 100644 index 0000000..6043aab --- /dev/null +++ b/Exceptionhandling.java @@ -0,0 +1,15 @@ +class Main { + public static void main(String[] args) { + + try { + + + int divideByZero = 5 / 0; + System.out.println("Rest of code in try block"); + } + + catch (ArithmeticException e) { + System.out.println("ArithmeticException => " + e.getMessage()); + } + } +}