1.

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 mentionedThis question was addressed to me in an internship interview.This interesting question is from Recursion topic in chapter Object Oriented Concepts of C#

Answer»

The correct OPTION is (a) Infinite loop CONDITION occurrence

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.



Discussion

No Comment Found

Related InterviewSolutions