As for unchecked exceptions, there are also predefined classes for checked exceptions, which are also implicitly included by the java.lang
package without an import statement.
Exception | Description |
---|---|
CloneNotSupportedException | 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.Applications that override the clone method can also throw this exception to indicate that an object could not or should not be cloned. |
ClassNotFoundException | Thrown when an application tries to load in a class through its string name using: – The forName method in class Class .– The findSystemClass method in class ClassLoader .– The loadClass method in class ClassLoader .but no definition for the class with the specified name could be found. |
NoSuchFieldException | Signals that the class doesn’t have a field of a specified name. |
NoSuchMethodException | Thrown when a particular method cannot be found. |
InterruptedException | Thrown when a thread is waiting, sleeping, or otherwise occupied, and the thread is interrupted, either before or during the activity. Occasionally a method may wish to test whether the current thread has been interrupted, and if so, to immediately throw this exception. |
InstantiationException | 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. |