Class ProgrammerDefinedExceptionsDemo


  • public class ProgrammerDefinedExceptionsDemo
    extends java.lang.Object
    Copyright: Copyright (c) 2002 Author: Carl B. Struck Company: SCCC West Description: Testing the programmer-defined classes Quotient and DivideByZeroException
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void main​(java.lang.String[] args)  
      static double quotient​(double numerator, double denominator)
      Returns the result of dividing the numerator by the denominator.
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ProgrammerDefinedExceptionsDemo

        public ProgrammerDefinedExceptionsDemo()
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
      • quotient

        public static double quotient​(double numerator,
                                      double denominator)
                               throws DivideByZeroException
        Returns the result of dividing the numerator by the denominator.
        Parameters:
        numerator - the numerator for division
        denominator - the numerator for division
        Returns:
        the result of the division
        Throws:
        DivideByZeroException - if the denominator is zero (0)