---
title: "Explain the difference between checked and unchecked exceptions in .NET Core."  
description: "Explain the difference between checked and unchecked exceptions in .NET Core."  
author: "Revati S Misra"  
published: 2023-10-12  
updated: 2023-10-12  
canonical: https://www.mindstick.com/forum/160107/explain-the-difference-between-checked-and-unchecked-exceptions-in-dot-net-core  
category: ".net core"  
tags: ["asp.net", "api(s)", ".net core"]  
reading_time: 2 minutes  

---

# Explain the difference between checked and unchecked exceptions in .NET Core.

[Explain the difference](https://www.mindstick.com/forum/156125/can-you-explain-the-difference-between-organic-and-paid-results) between [checked and unchecked exceptions](https://www.mindstick.com/forum/159233/explain-the-difference-between-checked-and-unchecked-exceptions-in-java) in .NET Core.

## Replies

### Reply by Aryan Kumar

In .NET Core (and C#), [exceptions](https://www.mindstick.com/interview/22871/define-predifined-generic-exceptions) are not explicitly categorized as "checked" or "unchecked" as they are in some other programming languages like Java. Instead, exceptions are generally divided into two broad categories: "checked exceptions" and "unchecked exceptions." However, this terminology is not commonly used in the .NET ecosystem. Here's an explanation of these two categories:

## Checked Exceptions (Common in Java):

- In languages like Java, "checked exceptions" are exceptions that must be either caught (handled) or declared in the method signature using the **throws** keyword. These exceptions are checked at compile time to ensure that the developer has accounted for the possibility of the exception occurring.
- Checked exceptions typically represent expected or recoverable errors. For example, when working with file I/O or network operations, you may encounter exceptions like **FileNotFoundException** or **IOException**. You are required to handle these exceptions explicitly in your code.
- In .NET, there is no direct equivalent to checked exceptions. Instead, exceptions are generally unchecked, meaning you are not forced to catch them or declare them in method signatures.

## Unchecked Exceptions (Common in .NET):

- In .NET and C#, exceptions are often referred to as "unchecked exceptions" or simply "exceptions." These exceptions can be caught and handled using **try-catch** blocks, but there is no requirement to declare them in method signatures.
- Unchecked exceptions typically represent unexpected or unrecoverable errors. These can be system exceptions like **NullReferenceException** or **DivideByZeroException**. While you can catch and handle them, the primary focus is on prevention and avoiding their occurrence through careful coding practices.

In summary, the terms "checked exceptions" and "unchecked exceptions" are more commonly associated with the Java programming language and are not a standard part of the terminology used in .NET Core or C#. In .NET, all exceptions can be caught and handled, but there is no specific language feature to enforce handling or declaration of exceptions in method signatures as is the case with checked exceptions in Java. Instead, best practices in .NET revolve around handling exceptions effectively and preventing them through good coding practices.


---

Original Source: https://www.mindstick.com/forum/160107/explain-the-difference-between-checked-and-unchecked-exceptions-in-dot-net-core

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
