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…