What Will Be The Output Of The Following Java Programp Pre #299
What will be the output of the following Java program?</p> <pre><code class="language-java" line="1"> class recursion { int fact(int n) { int result; if (n == 1) return 1; result = fact(n - 1) * n; return result; } } class Output { public static void main(String args[]) { recursion obj = new recursion() ; System.out.print(obj.fact(1)); } }</code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs128 Java. It can also be found in gs gs128 Java Classes Methods - Java Recursion - Quiz No.1.