---
title: "How does a try statement determine which catch clause should be used to handle an exception?"  
description: "How does a try statement determine which catch clause should be used to handle an exception?"  
author: "Sumit Kesarwani"  
published: 2014-08-26  
updated: 2020-09-15  
canonical: https://www.mindstick.com/interview/2027/how-does-a-try-statement-determine-which-catch-clause-should-be-used-to-handle-an-exception  
category: "java"  
tags: ["java"]  
reading_time: 1 minute  

---

# How does a try statement determine which catch clause should be used to handle an exception?

When an exception is thrown within the body of a try statement, the catch clauses of the try statement are examined in the order in which they appear. The first catch clause that is capable of handling the exceptionis executed. The remaining catch clauses are ignored.

## Answers

### Answer by Sumit Kesarwani

When an exception is thrown within the body of a try statement, the catch clauses of the try statement are examined in the order in which they appear. The first catch clause that is capable of handling the exceptionis executed. The remaining catch clauses are ignored.


---

Original Source: https://www.mindstick.com/interview/2027/how-does-a-try-statement-determine-which-catch-clause-should-be-used-to-handle-an-exception

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
