Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Suppose guess is some integer recursive method. Which of thefollowing would be a

ID: 3608231 • Letter: S

Question

Suppose guess is some integer recursive method. Which of thefollowing would be an appropriate (as opposed to a valid) way toinvoke the method?           publicint guess(int a, int b) I.guess(3,4); II. System.out.println(guess(3,4)); III. answer = guess(3,4); a) I only b) I and II only c) II and III only d) I and III only e) I, II, and III Suppose guess is some integer recursive method. Which of thefollowing would be an appropriate (as opposed to a valid) way toinvoke the method?           publicint guess(int a, int b) I.guess(3,4); II. System.out.println(guess(3,4)); III. answer = guess(3,4); a) I only b) I and II only c) II and III only d) I and III only e) I, II, and III

Explanation / Answer


I.guess(3,4);       /* thisstatement will call guess(3,4) so it is valid */ II. System.out.println(guess(3,4));    /* Thisstatmenet will call guess(3,4) and print the return valude so it isalso valid */ III. answer = guess(3,4);      /* this statement will call guess(3,4)and return value will be stored in answer .. so it is valid*/
a) I only b) I and II only c) II and III only d) I and III only e) I, II, andIII

I.guess(3,4);       /* thisstatement will call guess(3,4) so it is valid */ II. System.out.println(guess(3,4));    /* Thisstatmenet will call guess(3,4) and print the return valude so it isalso valid */ III. answer = guess(3,4);      /* this statement will call guess(3,4)and return value will be stored in answer .. so it is valid*/
a) I only b) I and II only c) II and III only d) I and III only e) I, II, andIII