Is it always bad to get a StackOverflowError, or can it be intentional?

Question

Grade: Education Subject: Support
Is it always bad to get a StackOverflowError, or can it be intentional?
Asked by:
71 Viewed 71 Answers

Answer (71)

Best Answer
(328)
A StackOverflowError is almost always an unintentional error indicating a bug in the code, usually an infinite recursion. While theoretically one could design a system that intentionally triggers it, this is highly impractical and would lead to unstable program behavior. It's a clear signal that your program's logic is flawed.