COMPILER DESIGN

ADVANCED TOPICS IN COMPILER DESIGN

CODE GENERATION FOR OBJECT ORIENTED LANGUAGES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which of these keywords must be used to handle the exception thrown by try block?
A
try
B
finally
C
throw
D
catch
Explanation: 

Detailed explanation-1: -Explanation: finally keyword is used to execute the code before try and catch block end.

Detailed explanation-2: -Explanation: try is used for the block that needs to checked for exception. 3. Which of these keywords are used for the block to handle the exceptions generated by try block? Explanation: None.

Detailed explanation-3: -The Catch Block of Try Catch in Java The catch block catches and handles the try block exceptions by declaring the type of exception within the parameter. The catch block includes the code and it is executed if an exception inside the try block occurs.

There is 1 question to complete.