Study

Recursion in Java

  •   0%
  •  0     0     0

  • Where is/are the recursive call(s) in the getArea() method?
    line #4
  • The _________________ is the instance where a recursive method will return a value rather than calling itself.
    base case
  • What value is returned from a call to mystery(3,6)?
    18
  • What value is returned from a call to mystery(1,5)?
    5
  • What is printed for the call myPrint(8)?
    8
  • Complete the code for the recursive method printSum, which is intended to return the sum of digits from 1 to n.
    (n + printSum(n - 1))