Ques 1 Exception
What is the output of the following Java Code?
class Exception{ public static void main(String[] args){ try{ throw 5; } catch(int ex){ System.out.println("Exception: " + ex); } } }
Ques 2 Exception
Which block of code must be used to enclose the code that might throw an exception?
Ques 3 Exception
In a catch block, which parameter allows you to reference the caught exception object?
Ques 4 Exception
Which type of exception occurs due to problems that are not caused by the program's logic but by external factors like network issues or file not found?
Ques 5 Exception
What is the output of the following Java Code?
try { throw new RuntimeException("Custom exception"); } catch (RuntimeException e) { System.out.println("RuntimeException: " + e.getMessage()); } catch (Exception e) { System.out.println("Exception: " + e.getMessage()); }