Given the code fragment:
You must define the A exception class. The program execution must be terminated if the condition at line 19 is true and an A exception is thrown at line 20.
Which code fragment at line n1 defines A as per the requirement?
Given the code fragment:
You must define the A exception class. The program execution must be terminated if the condition at line 19 is true and an A exception is thrown at line 20.
Which code fragment at line n1 defines A as per the requirement?
In order for the program execution to terminate immediately when the A exception is thrown, the A class should extend Throwable directly. If A extends Exception, it will be caught by the catch block, and the program will continue to the next line, printing 'Continue...'. Extending Throwable ensures that the exception is not caught by the catch block and thus terminates the program.
a IS CORRECT for finish program in line 20, others catch in exception clause an conitnue program
see below
answer : A B is not correct According to the source code only exceptions extended from Throwable type and not from an Exception type are not caught. It could be Error or even checked type of exception.