Java OCA OCP Practice Question 1408

Question

Fill in the blanks:

The ___ keyword is used in method declarations,

the ___ keyword is used to guarantee a statement will execute even if an exception is thrown,

and the ___ keyword is used to throw an exception to the surrounding process.

  • A. throw, finally, throws
  • B. throws, catch, throw
  • C. catch, finally, throw
  • D. finally, catch, throw
  • E. throws, finally, throw


E.

Note

The throws keyword is used in method declarations,

while the throw keyword is used to throw an exception to the surrounding process,

and the finally keyword is used to add a statement that is guaranteed to execute even if an exception is thrown.

Option E is the correct answer.




PreviousNext

Related