< prev index next >

src/java.base/share/classes/java/lang/ArithmeticException.java

Print this page




  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package java.lang;
  27 
  28 /**
  29  * Thrown when an exceptional arithmetic condition has occurred. For
  30  * example, an integer "divide by zero" throws an
  31  * instance of this class.
  32  *
  33  * {@code ArithmeticException} objects may be constructed by the
  34  * virtual machine as if {@linkplain Throwable#Throwable(String,
  35  * Throwable, boolean, boolean) suppression were disabled and/or the
  36  * stack trace was not writable}.
  37  *
  38  * @author  unascribed
  39  * @since   1.0
  40  */
  41 public class ArithmeticException extends RuntimeException {

  42     private static final long serialVersionUID = 2256477558314496007L;
  43 
  44     /**
  45      * Constructs an {@code ArithmeticException} with no detail
  46      * message.
  47      */
  48     public ArithmeticException() {
  49         super();
  50     }
  51 
  52     /**
  53      * Constructs an {@code ArithmeticException} with the specified
  54      * detail message.
  55      *
  56      * @param   s   the detail message.
  57      */
  58     public ArithmeticException(String s) {
  59         super(s);
  60     }
  61 }


  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package java.lang;
  27 
  28 /**
  29  * Thrown when an exceptional arithmetic condition has occurred. For
  30  * example, an integer "divide by zero" throws an
  31  * instance of this class.
  32  *
  33  * {@code ArithmeticException} objects may be constructed by the
  34  * virtual machine as if {@linkplain Throwable#Throwable(String,
  35  * Throwable, boolean, boolean) suppression were disabled and/or the
  36  * stack trace was not writable}.
  37  *
  38  * @author  unascribed
  39  * @since   1.0
  40  */
  41 public class ArithmeticException extends RuntimeException {
  42     @java.io.Serial
  43     private static final long serialVersionUID = 2256477558314496007L;
  44 
  45     /**
  46      * Constructs an {@code ArithmeticException} with no detail
  47      * message.
  48      */
  49     public ArithmeticException() {
  50         super();
  51     }
  52 
  53     /**
  54      * Constructs an {@code ArithmeticException} with the specified
  55      * detail message.
  56      *
  57      * @param   s   the detail message.
  58      */
  59     public ArithmeticException(String s) {
  60         super(s);
  61     }
  62 }
< prev index next >