1
Answer

I am wondering why it catches StackOverflowException

Tommy Sin

Tommy Sin

13y
1.5k
1
I wonder why it catches StackOverflowException before it terminates. I believe there is no local variable declared that is supposed to be stored on stack in "static void Recursive()" function. Could anyone please explain how StackOveflowException occurs in details in this case?
Thanks


class program
{
        static void Main(string[] args)
        {
                Recursive();
        }

        static void Recursive()
        {
                Recursive();
        }
}
Answers (1)