What are the common exception classes in Java?

Article Directory

exception name describe
NullPointerException Null pointer exception;
SQLException Database-related exceptions;
IndexOutOfBoundsException An array subscript out of bounds exception;
FileNotFoundException Thrown when opening a file fails;
IOException Thrown when some kind of IO exception occurs;
ClassCastException This exception is thrown when an attempt is made to cast an object to a subclass that is not an instance;
NoSuchMethodException Throws when a method cannot be found;
ArrayStoreException Exception thrown when attempting to store an object of the wrong type into an array of objects;
NumberFormatException When trying to convert a string to a number, it fails, throwing;
IllegalArgumentException The exception thrown indicates that an illegal or incorrect parameter was passed to the method.
ArithmeticException This exception is thrown when an abnormal operation condition occurs. For example, an instance of this class is thrown when an integer is "divided by zero".

Guess you like

Origin blog.csdn.net/m0_48170265/article/details/130344525