Question: 1. Create a class to define and test linear recursion. Name the class Linear. Implement the following: . A public class named Linear. A

1. Create a class to define and test linear recursion. Name the class Linear. Implement the following: . A public class named "Linear". A pubic static method named "factorial" that takes a double and returns a double. The base case should check whether the input value is less than or equal to 1. The recursive case should return the input value multiplied against the result of a recursive call to the factorial method with the input value minus 1. Create a static main method that tests the following: A double variable named "d". Check if the argument list contains any values, and assign the value of argument zero to the local double variable. If the argument list is empty assign a value of 5.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
