Recursion

AP Computer Science A· difficulty 4/5

A recursive method without a proper base case causes

  • A

    Compile error

  • B

    StackOverflowError at runtime

    check_circle
  • C

    Infinite loop

  • D

    Returns null

Explanation

Each recursive call adds a stack frame; eventually exhausts stack.

Want 10 more like this — adaptive to your weak spots?

Related questions