my current code:
class throwdemo { static void throwmethod() { system.out.println("inside throwmethod"); throw new illegalaccessexception("demo"); } public static void main(string args[]) { try { throwmethod(); } catch(illegalaccessexception e) { system.out.println("caught"+e); } } }
upto knowledge exception thrown throwmethod
must caught. why illegalaccessexception
thrown throwmethod
not caught catch?
Comments
Post a Comment