Skip to main content

Write a java program to use the try and catch and finally block.

· One min read
Kaustubh Kulkarni
public class ExceptionHandling {
public static void main(String[] args) {
try {
int i = 10/0;

catch(Exception ex){
System.out.println("Catch Block Called");

finally {
System.out.println("Finally Block");


LENOVO@DESKTOP-U7S0DTI MINGW64 /e/H-drive/Practicals/MCA/SEM III/JAVA/Practicals/assignment no1
$ java
Catch Block Called
Finally Block