Question: Subject : JAVA PROGRAMMING Given that the following method definition belongs to a class. int evaluate (int x) if (x1) return 1; else return x
Given that the following method definition belongs to a class. int evaluate (int x) if (x1) return 1; else return x + evaluate(x-1); What is displayed when the following statement is called? ystem.out.printin("The result is"+evaluate( 5) ); 54321 543210 21 15 The code will not compile because the keyword, if, wants the associated keyword, else
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
