programs of exception handling
programs of exception handling
Output:
// Always execute
finally {
// Java program to demonstrate finally block When exception rise and not
handled by catch
import java.io.*;
class GFG {
public static void main(String[] args)
{
try {
System.out.println("Inside try block");
// Always execute
finally {
System.out.println(
"finally : i will execute always.");
}
// This will not execute
System.out.println("i want to run");
}
}