Input
Output
public class Throwexception{ public static void main(String args[]){ try{ int a=5; if(18 > a){ throw new IllegalAccessException("Not Eligible"); } else{ System.out.println("successfull"); } } catch(IllegalAccessException e){ System.out.println(e); } finally{ System.out.println("Always execute"); } } }