Table of Contents
In this tutorial, we will discuss the concept of Exception handling in Java language.
Exception handling is one of the important, most useful and powerfull mechanism to handle the runtime error in Java. We will discuss the five keywords for exception handling in Java.
When can an exception occur?
An exception can occur twice:
Java exceptions are basically java objects.
Unlike errors, exceptions can be used to prevent the program from terminating automatically.
Exceptions can be handled using the try and catch blocks.
Error
An error is thrown by the java runtime system and indicates that some irrecoverable condition has occured during execution of the program.
Different between exceptions and errors
An exception can be handled as a user or programmer but we can not handle the Error by user or programmer
What type of exception occur?
Two type of exception occur
We can use five keywords in exception handling in Java
}
How to Handle Arithmetic Exception in Java
Program 1
Program 2
Program 3
How to handle array index out of bound of exception in Java
Program 1
Program 2
Program 3
Related Links
Abstract class in C++ Abstract class in Java
Encapsulation in C++ Encapsulation in Java
Multiply two numbers in Java using scanner| 5 different ways In this article, we will…
5 Different ways to Divide two numbers in Java using scanner In this article, we…
Learn 8 Ways to Subtract Two Numbers Using Methods in Java In this article, we…
10 ways to subtract two numbers in Java In this article, we will discuss the…
Java Code Examples – Multiply Two Numbers in 5 Easy Ways In this article, we…
How to Divide two numbers in Java| 5 different ways In this article, we will…
This website uses cookies.