---
title: "exception handling in java"  
description: "Exception handling in java???before describing technical definition, first of all elaborate what is exception?Exception stands an event that disrupts"  
author: "ANkita gupta"  
published: 2015-11-19  
updated: 2020-03-04  
canonical: https://www.mindstick.com/articles/11920/exception-handling-in-java  
category: "java"  
tags: ["java"]  
reading_time: 1 minute  

---

# exception handling in java

[Exception handling](https://www.mindstick.com/articles/12240/introduction-of-exception-handling) in java???before describing [technical](https://www.mindstick.com/forum/85242/what-are-the-technical-highlights-for-software-testing) [definition](https://yourviews.mindstick.com/view/70598/false-furore-over-the-leadership-definition-statement-of-army-chief-bipin-rawat), first of all elaborate what is exception?Exception stands an event that disrupts the normal flow of the program. It is an object which is thrown at run time.Technical definition it is an mechanism to [handle runtime](https://www.mindstick.com/forum/159700/how-to-handle-runtime-errors-in-a-dot-net-core-api) errors such as classnotfound, SQL, remote etc.\
Core Advantage of Exception Handling:It is to maintain the normal flow of the [application](https://www.mindstick.com/articles/12824/calculator-application-in-android). Exception normally disrupts the normal flow of the application that is why we use exception handling.\
**Let's take an e.g.**statement 1; statement 2; statement 3; statement 4; statement 5;//exception occurs statement 6; statement 7; statement 8; statement 9; statement 10; \
Suppose there is 10 statements in [your program](https://answers.mindstick.com/qa/33494/how-do-you-find-any-view-element-into-your-program-explain-for-example) and there occurs an exception at statement 5, rest of the code will not be executed i.e. statement 6 to 10 will not run. If we perform exception handling, rest of the statement will be executed. That is why we use exception handling in java.**TYPES OF EXCEPTION:**\
There are mainly two types of [exceptions](https://www.mindstick.com/interview/22871/define-predifined-generic-exceptions): checked and unchecked where error is [considered as](https://www.mindstick.com/forum/156093/what-is-considered-as-more-significant-creating-content-or-building-backlinks) unchecked exception. **The sun microsystem says there are three types of exceptions:**

[Checked Exception](https://www.mindstick.com/blog/304521/differentiate-between-checked-and-unchecked-exceptions-in-java-with-examples)

Unchecked Exception

Error.

\

---

Original Source: https://www.mindstick.com/articles/11920/exception-handling-in-java

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
