---
title: "Can Multiple Catch Blocks execute in c#?"  
description: "Can Multiple Catch Blocks execute in c#?"  
author: "Navya Khurana"  
published: 2017-12-19  
canonical: https://answers.mindstick.com/qa/31830/can-multiple-catch-blocks-execute-in-c-sharp  
category: "technology"  
tags: ["c#"]  
reading_time: 2 minutes  

---

# Can Multiple Catch Blocks execute in c#?

Can [Multiple Catch Blocks](https://www.mindstick.com/forum/159236/explain-the-concept-of-multiple-catch-blocks-in-java-and-their-order-of-execution) execute in c#?

## Answers

### Answer by Hemant Patel

Hi Navya,

In C# only ***one Catch block executed at a time,*** but you can use [multiple Catch](https://www.mindstick.com/interview/2598/can-multiple-catch-block-be-executed) block in your method. I think it's not good enough, So now we detailed this phenomenon.

```
using System;
class Demo{
    public static void Main() {
        int a = 0;
        int division = 0;
        try {
            division = 100 / x;
            Console.WriteLine("Line is not executed");
        } catch (DivideByZeroException exDev) {
            Console.WriteLine("DivideByZeroException");
        } catch (Exception e) {
            Console.WriteLine("Exception");
        } finally {
            Console.WriteLine("Finally Block Executed");
        }
        Console.WriteLine("Solution is {0}", division );
    }
} 
```

In C# you can use multiple catch block for a try block, but when try block statement is executed, All Catch block match exception type with their signature, and execute only one catch block at a time whose signature matches exception type. That's why we can say that **Only one Catch block executed at a time.**

## *I Hope it's Informative...*


---

Original Source: https://answers.mindstick.com/qa/31830/can-multiple-catch-blocks-execute-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
