0

When I call this method in a try catch, stackoverflow is not able to be handled.

public int Calculate()
{
    while (true)
    {
        Calculate();
    }
}

public void Call()
{
    try
    {
        Calculate();
    }
    catch (Exception ex)
    {
        System.Console.WriteLine(ex.Message);          
    }
}

any idea?

Murray Foxcroft
  • 11,972
  • 4
  • 54
  • 79
FreeMan
  • 1,327
  • 12
  • 20

0 Answers0