Which line of code in the Java program below is the recursive invocation of method myFun?
1 public class test03
2 {
3 public static void main(String[] args)
4 {
5 for (int i = 0; i < 4; i++)
6 {
7 System.out.print(myFun(i) + " ") ;
8 }
9 System.out.println() ;
10 }
11 public static int myFun(int perfect)
12 {
13 return ((perfect - 1) * (perfect - 1) ) ;
14 }
15 }
A) 7
B) 11
C) 13
D) There is no recursive invocation
Correct Answer:
Verified
Q7: Which process helps with identifying the methods
Q8: Which statement about the steps for implementing
Q9: What is the output from the following
Q10: If a method is declared to return
Q11: The term "Black Box" is used with
Q13: Which of the following is NOT a
Q14: A stub method is
A) A short method
B)
Q15: The variable name perfect in the method
Q16: Which option represents a legal invocation of
Q17: Parameter variables should not be changed within
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents