AdSense

AdSense3

Monday 22 September 2014

Java.lang.Exceptions


The java.lang.Exceptions provides for different exceptions thrown under java lang package.

Exception Summary

S.N.Exception & Description
1ArithmeticException
This is Thrown when an exceptional arithmetic condition has occurred.
2ArrayIndexOutOfBoundsException
This is Thrown to indicate that an array has been accessed with an illegal index.
3ArrayStoreException
This is Thrown to indicate that an attempt has been made to store the wrong type of object into an array of objects.
4ClassCastException
This is Thrown to indicate that the code has attempted to cast an object to a subclass of which it is not an instance.
5ClassNotFoundException
This is Thrown when an application tries to load in a class through its string name using: The forName method in class Class.
6CloneNotSupportedException
This is Thrown to indicate that the clone method in class Object has been called to clone an object, but that the object's class does not implement the Cloneable interface.
7EnumConstantNotPresentException
This is Thrown when an application tries to access an enum constant by name and the enum type contains no constant with the specified name.
8Exception
This is the class Exception and its subclasses are a form of Throwable that indicates conditions that a reasonable application might want to catch.
9IllegalAccessException
This is an IllegalAccessException is thrown when an application tries to reflectively create an instance (other than an array), set or get a field, or invoke a method, but the currently executing method does not have access to the definition of the specified class, field, method or constructor.
10IllegalArgumentException
This is Thrown to indicate that a method has been passed an illegal or inappropriate argument.
11IllegalMonitorStateException
This is Thrown to indicate that a thread has attempted to wait on an object's monitor or to notify other threads waiting on an object's monitor without owning the specified monitor.
12IllegalStateException
The Signals that a method has been invoked at an illegal or inappropriate time.
13IllegalThreadStateException
This is Thrown to indicate that a thread is not in an appropriate state for the requested operation.
14IndexOutOfBoundsException
This is Thrown to indicate that an index of some sort (such as to an array, to a string, or to a vector) is out of range.
15InstantiationException
This is Thrown when an application tries to create an instance of a class using the newInstance method in class Class, but the specified class object cannot be instantiated.
16InterruptedException
This is Thrown when a thread is waiting, sleeping, or otherwise occupied, and the thread is interrupted, either before or during the activity.
17NegativeArraySizeException
This is Thrown if an application tries to create an array with negative size.
18NoSuchFieldException
The Signals that the class doesn't have a field of a specified name.
19NoSuchMethodException
This is Thrown when a particular method cannot be found.
20NullPointerException
This is Thrown when an application attempts to use null in a case where an object is required.
21NumberFormatException
This is Thrown to indicate that the application has attempted to convert a string to one of the numeric types, but that the string does not have the appropriate format.
22RuntimeException
This is RuntimeException is the superclass of those exceptions that can be thrown during the normal operation of the Java Virtual Machine.
23SecurityException
This is Thrown by the security manager to indicate a security violation.
24StringIndexOutOfBoundsException
This is Thrown by String methods to indicate that an index is either negative or greater than the size of the string.
25TypeNotPresentException
This is Thrown when an application tries to access a type using a string representing the type's name, but no definition for the type with the specified name can be found.
26UnsupportedOperationException
This is Thrown to indicate that the requested operation is not supported.

Java - Built-in Exceptions

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.
ExceptionDescription
ArithmeticExceptionArithmetic error, such as divide-by-zero.
ArrayIndexOutOfBoundsExceptionArray index is out-of-bounds.
ArrayStoreExceptionAssignment to an array element of an incompatible type.
ClassCastExceptionInvalid cast.
IllegalArgumentExceptionIllegal argument used to invoke a method.
IllegalMonitorStateExceptionIllegal monitor operation, such as waiting on an unlocked thread.
IllegalStateExceptionEnvironment or application is in incorrect state.
IllegalThreadStateExceptionRequested operation not compatible with current thread state.
IndexOutOfBoundsExceptionSome type of index is out-of-bounds.
NegativeArraySizeExceptionArray created with a negative size.
NullPointerExceptionInvalid use of a null reference.
NumberFormatExceptionInvalid conversion of a string to a numeric format.
SecurityExceptionAttempt to violate security.
StringIndexOutOfBoundsAttempt to index outside the bounds of a string.
UnsupportedOperationExceptionAn unsupported operation was encountered.
Following is the list of Java Checked Exceptions Defined in java.lang.
ExceptionDescription
ClassNotFoundExceptionClass not found.
CloneNotSupportedExceptionAttempt to clone an object that does not implement the Cloneable interface.
IllegalAccessExceptionAccess to a class is denied.
InstantiationExceptionAttempt to create an object of an abstract class or interface.
InterruptedExceptionOne thread has been interrupted by another thread.
NoSuchFieldExceptionA requested field does not exist.
NoSuchMethodExceptionA requested method does not exist.


No comments:

Post a Comment