Question: Consider the following code public static double divide(double a, double b) { return a/b: } public static void printQuotient(double a, double b) { System.out.println(divide(a, b)):
Consider the following code public static double divide(double a, double b) { return a/b: } public static void printQuotient(double a, double b) { System.out.println(divide(a, b)): } Change the divide method so it throws an IIlegalArgumentException with a message if b is zero. Change the printQuotient method so that it catches the exception that the di could throw
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
