2022 Developer Survey is open! Take survey.

try-catch is used to catch the exception.

try-catch is used to catch the exception and stop system being broken.

try-catch is generally when we are suspicious about particular statements, and want to avoid system from breaking.

Efficient use of try-catch block make system robust.