Try And Finally Without Catch Block

1. We Can Use Finally after try block ,it will run gives message in finally block.But can not handle exception.




public class ExceptionSample {
public static void main(String[] args) {
try {
int i=10/0;
System.out.println(“Finally Block”);
System.out.println(“You Are Come Back In Main”);


Exception in thread “main” Finally Block
java.lang.ArithmeticException: / by zero
at exception_handling.ExceptionSample.main(

Leave a Reply

Your email address will not be published. Required fields are marked *

39 − 35 =