Finally Keyword in Java Example Program – Exception Handling

By | December 22, 2010
You can find Finally Keyword in Java Example Program.The concept of Exception Handling Finally keyword sample code.

You can find Finally Keyword in Java Example Program.The concept of Exception Handling Finally keyword sample code.

public class FinallyDemo{
public static void main(String args[]){
try{
System.out.println(“\n\tInside main method…”);
throw new ArithmeticException();
}catch(ArithmeticException e){}
finally{
System.out.println(“\n\tInside finally block…”);
}
System.out.println(“\n\tLast statement in main…”);
}
}
Result:
Inside main method…
Inside finally block…
Last statement in main…

Leave a Reply

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