nerdexam
GIAC

GSSP-NET · Question #30

What is the main purpose of a try-catch block?

The correct answer is C. To catch and handle an exception generated by an executable code. See the full explanation below for the reasoning.

Question

What is the main purpose of a try-catch block?

Options

  • ATo obtain and use resources that are being caught.
  • BTo signal the occurrence of an exception during the program execution.
  • CTo catch and handle an exception generated by an executable code.
  • DTo ensure that the necessary cleanup of external resources is done immediately.

How the community answered

(31 responses)
  • A
    3% (1)
  • B
    3% (1)
  • C
    84% (26)
  • D
    10% (3)

Community Discussion

No community discussion yet for this question.

Full GSSP-NET Practice