Which of these will happen if the recursive method does not have a base case?

Lượng Tiger

New member
Which of these will happen if the recursive method does not have a base case?
A. Infinite loop condition occurrence
B. System gets hanged
C. After 10000 executions program will be automatically stopped
D. None of the mentioned
 
Answer: a
Explanation: If a recursive method does not have a base case which is necessary to meet the end of condition then an infinite loop occurs which results in stackoverflow exception error.
 

Tìm kiếm

Back
Top