Class ProgrammerDefinedExceptionsDemo
- java.lang.Object
-
- ProgrammerDefinedExceptionsDemo
-
public class ProgrammerDefinedExceptionsDemo extends java.lang.ObjectCopyright: Copyright (c) 2002 Author: Carl B. Struck Company: SCCC West Description: Testing the programmer-defined classes Quotient and DivideByZeroException
-
-
Constructor Summary
Constructors Constructor Description ProgrammerDefinedExceptionsDemo()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidmain(java.lang.String[] args)static doublequotient(double numerator, double denominator)Returns the result of dividing the numerator by the denominator.
-
-
-
Method Detail
-
main
public static void main(java.lang.String[] args)
-
quotient
public static double quotient(double numerator, double denominator) throws DivideByZeroExceptionReturns the result of dividing the numerator by the denominator.- Parameters:
numerator- the numerator for divisiondenominator- the numerator for division- Returns:
- the result of the division
- Throws:
DivideByZeroException- if the denominator is zero (0)
-
-