Solved

Consider the Following Definition of a Recursive Method

Question 29

Multiple Choice

Consider the following definition of a recursive method. public static int strange(int[] list, int first, int last) {if (first == last) return list[first]; else return list[first] + strange(list, first + 1, last) ;} Given the declaration int[] beta = {2, 5, 8, 9, 13, 15, 18, 20, 23, 25}; What is the output of the following statement? System.out.println(strange(beta, 4, 7) ) ;


A) 27
B) 33
C) 55
D) 66

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions