1.

Which of these will happen if recursive method does not have a base case?(a) An infinite loop occurs(b) System stops the program after some time(c) After 1000000 calls it will be automatically stopped(d) None of the mentionedThe question was asked in a national level competition.My question is based upon Recursion topic in portion Classes and Methods of Java

Answer» CORRECT ANSWER is (a) An INFINITE loop occurs

Easiest explanation: If a RECURSIVE method does not have a base case then an infinite loop occurs which RESULTS in Stack Overflow.


Discussion

No Comment Found

Related InterviewSolutions