Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

What happens when a method calls itself inside its body?

807603Feb 20 2008 — edited Feb 21 2008
This is a dumb question but stil I am asking it because some how i feel the interviewer who asked me this question was not satisfied by the answer..

Question:

What happens when a method keeps calling itself in its body?

My Answer:

It comes out throwing java.lang.StackOverflowError runtime exception.

What i want to know is from all you JAVA GURUS, is there anything more to this sort of question. Any nuance i am missing here?

null
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 20 2008
Added on Feb 20 2008
6 comments
632 views