- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Built-in Exceptions in Javan
Java defines several exception classes inside the standard package java.lang.
The most general of these exceptions are subclasses of the standard type RuntimeException. Since java.lang is implicitly imported into all Java programs, most exceptions derived from RuntimeException are automatically available.
Java defines several other types of exceptions that relate to its various class libraries. Following is the list of Java Unchecked RuntimeException.
Sr.No. | Exception & Description |
---|---|
1 | ArithmeticException Arithmetic error, such as divide-by-zero. |
2 | ArrayIndexOutOfBoundsException Array index is out-of-bounds. |
3 | ArrayStoreException Assignment to an array element of an incompatible type. |
4 | ClassCastException Invalid cast. |
5 | IllegalArgumentException The illegal argument used to invoke a method. |
6 | IllegalMonitorStateException Illegal monitor operation, such as waiting on an unlocked thread. |
7 | IllegalStateException Environment or application is in an incorrect state. |
8 | IllegalThreadStateException Requested operation not compatible with the current thread state. |
9 | IndexOutOfBoundsException Some type of index is out-of-bounds. |
10 | NegativeArraySizeException The array created with a negative size. |
11 | NullPointerException Invalid use of a null reference. |
12 | NumberFormatException Invalid conversion of a string to a numeric format. |
13 | SecurityException Attempt to violate security. |
14 | StringIndexOutOfBounds Attempt to index outside the bounds of a string. |
15 | UnsupportedOperationException An unsupported operation was encountered. |
Following is the list of Java Checked Exceptions Defined in java.lang.
Sr.No. | Exception & Description |
---|---|
1 | ClassNotFoundException Class not found. |
2 | CloneNotSupportedException Attempt to clone an object that does not implement the Cloneable interface. |
3 | IllegalAccessException Access to a class is denied. |
4 | InstantiationException Attempt to create an object of an abstract class or interface. |
5 | InterruptedException One thread has been interrupted by another thread. |
6 | NoSuchFieldException A requested field does not exist. |
7 | NoSuchMethodException A requested method does not exist. |
- Related Articles
- Built-in Exceptions in Java
- Built-in Exceptions in C#
- Custom exceptions in Java
- Checked vs Unchecked exceptions in Java
- Can constructor throw exceptions in Java?
- What are chained exceptions in Java?
- What are checked exceptions in Java?
- What are unchecked exceptions in Java?
- What are custom exceptions in Java?
- User defined and custom exceptions in Java
- Checked Vs unchecked exceptions in Java programming.
- What are number format exceptions in Java?
- What are the in-built functional interfaces in Java?
- How can I add condition in custom exceptions in java?
- What is meant by re-throwing exceptions in Java?
- Built-in javascript constructors?

Advertisements