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

What is the main purpose of a try-catch block?
A . To obtain and use resources that are being caught.
B . To signal the occurrence of an exception during the program execution.
C . To catch and handle an exception generated by an executable code.
D . To ensure that the necessary cleanup of external resources is done immediately.

Answer: C

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments