Fiveable
Fiveable

Consider the following method: public void calculateFactorial(int n) { int factorial = 1; for (int i = 1; i <= n; i++) { factorial *= i; } printFactorial(n, factorial); } public void printFactorial(int n, int factorial) { System.out.print(n + "! = " + factorial); } Assume that the method calculateFactorial(5) appears in a method in the same class. What is printed as a result of the method call?




© 2024 Fiveable Inc. All rights reserved.

AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.


© 2024 Fiveable Inc. All rights reserved.

AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.