Question: 1. Create a custom exception class named ZeroDetection which inherits the ArithmaticException class. The class prints Zero is detected when it is thrown. Add

1. Create a custom exception class named ZeroDetection which inherits the ArithmaticException class. The class prints "Zero is detected" when it is thrown. Add a condition in the factorial() method in Assignment 6 to throw an exception if n is 0. 2. Rewrite the following iterative method as a recursive method that returns the same string. public String listOfNumbers () { String s = ""; for (j = s += j; return s; 1; j < 10; j++) }
Step by Step Solution
There are 3 Steps involved in it
Certainly Heres a solution 1 Custom Exception Class ja... View full answer
Get step-by-step solutions from verified subject matter experts
