Question: Inner Class Exercises 1. Define a class named Factorial that has the following methods: a. Constructor - Factorial (int lowerLimit, int upperLimit) b. toString() -

Inner Class Exercises 1. Define a class named Factorial that has the following methods: a. Constructor - Factorial (int lowerLimit, int upperLimit) b. toString() - returns a string wth the factorials of numbers starting at lowerLimit (inclusive) and ending at upperLimit (inclusive). For example, for lowerLimit 2 and upperLimit 4 the string returned will be: "2, 6, 24" 2. Write a Driver class with a main method to test your Factorial class. 3. Modify your Factorial class so that the following code will work: Factorial new Factorial (4, 13) for (Long y: x) t System.out.println(y); The output should be: 24 120 720 5040 40320 362880 3628800 39916800 479001600 6227020800 Hint: Make the Factorial class implement the Iterable
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
