Question: Rewrite Listing 38.11 to handle a large factorial. Use the BigInteger class introduced in 14.12. Data from Listing 38.11 package chapter38: 2 3 1mport java.text.:
Rewrite Listing 38.11 to handle a large factorial. Use the BigInteger class introduced in §14.12.
Data from Listing 38.11


package chapter38: 2 3 1mport java.text.: 4 5 publ 1c class NewFactorialBean { private int number: 6 7 ** Return number property / public int getNumber () { return number: 8 9 10 11 12 13 14 * Set number property publ1c votd setNumber (int newValue) { 15 number = newValue: 16 17 1** Obtain factorial / pub11c long getFactorial (0 { long factorial = 1; 18 19 20
Step by Step Solution
3.40 Rating (175 Votes )
There are 3 Steps involved in it
BigInteger is an inbuilt class in java it is used to han... View full answer
Get step-by-step solutions from verified subject matter experts
