ArithmeticException

ArithmeticException

ArithmeticException是出現異常的運算條件時,拋出此異常。例如,一個整數“除以零”時,拋出此類的一個實例。

基本介紹


類 ArithmeticException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
java.lang.ArithmeticException
所有已實現的介面:
java.io.Serializable
public class ArithmeticException extends RuntimeException當出現異常的運算條件時,拋出此異常。例如,一個整數“除以零”時,拋出此類的一個實例。
從以下版本開始:
JDK1.0
另請參見:
序列化表格
ArithmeticException()
構造不帶詳細消息的 ArithmeticException。
ArithmeticException(String s)
構造具有指定詳細消息的 ArithmeticException。
方法摘要
從類 java.lang.Throwable 繼承的方法
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
從類 java.lang.Object 繼承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
構造方法詳細信息
ArithmeticException
public ArithmeticException()構造不帶詳細消息的 ArithmeticException。
ArithmeticException
public ArithmeticException(String s)構造具有指定詳細消息的 ArithmeticException。
參數:
s - 詳細消息。