StackOverflowError
occurs due to an application recurses too deeply (This is not an answer you are expecting).
Now other things to happen to StackOverflowError
is keep calling methods from methods till you get StackOverflowError
, but nobody can program to get StackOverflowError
and even if those programmer are doing so then they are not following coding standards for cyclomatic complixity that every programmer has to understand while programming. Such reason for 'StackOverflowError' will require much time to rectify it.
But unknowingly coding one line or two line which causes StackOverflowError
is understandable and JVM throws that and we can rectify it instantly. Here is my answer with picture for some other question.