lets say NoMatchExcepton extends Exception
pay attention to two things :
multi-catch exceptions can not be subclassed
order of catch blocks subclass before superclass
Evrth is ok with that
So just two lines are printed
Tested: D. Example of NoMatchException as custom exception class could be:
class NoMatchException extends Exception {
public static void main(String args[])
{ System.out.println("No Match Exception Caught!" ); }}
The code provided is missing the definition of the NoMatchException class. If we assume that NoMatchException is a custom exception class that extends Exception or RuntimeException, then the code will compile and run without any issues.
The first catch block will catch this exception and print "Exception 1" to the console. After that, the finally block will be executed, printing "Finally Block" to the console.
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
ASPushkin
1 month, 3 weeks agoOmnisumem
9 months, 1 week agoStavok
11 months, 3 weeks agoJtic
1 year, 4 months ago