Define a MoreMath class that has a factorial method that takes an integer and returns the factorial of that integer. Make this method a class method by using the keyword static in the method declaration after the public keyword.
What will be an ideal response?
```
/¤¤
¤ Clas s f o r more mathemat ical f u n c t i o n s
¤ @author Barb Er icson
¤/
public clas s MoreMath
f
/**
* Method to c a l c u l a t e the f a c t o r i a l of a number
* @param the number to use in the c a l c u l a t i o n
* @return the f a c t o r i a l of the number
*/
public static intfactorial ( int n)
{
i f (n == 0)
return 1 ;
else
return n * factorial (n-1);
}
}
```
You might also like to view...
The command to display the word UNIX in quotation marks is:
a. echo "UNIX" b. echo ""UNIX"" c. echo " \"UNIX\" " d. display "UNIX"
Mnemonics can be used with all subclasses of which class?
a. AbstractButton. b. JMenu. c. JMenuItem d. JComponent.
After a chart is selected, the chart's associated ________ point cells are bordered in blue
Fill in the blank(s) with correct word
When you add buttons to the Quick Access Toolbar, the buttons are available to all documents
Indicate whether the statement is true or false