II B.Tech II Sem CSE Java Lab Exercise - 7a (Exception) II B.Tech II Sem CSE Java Lab Exercise - 7a (Exception) netaji gandi Monday, January 6, 2020 JAVA PROGRAMMING LAB R16 Edit a) Exception handling mechanism Aim: To write a JAVA program that describes exception handling mechanism Description: Program: Usage of Exception Handling: class trydemo { public static void main(String args[]) { try { int a=10,b=0; int c=a/b; System.out.println(c); } catch(ArithmeticException e) { System.out.println(e); } System.out.println("After the catch statement"); } } Output: Share This: Facebook Twitter Google Plus Pinterest Linkedin
No comments