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
  • 12,785
  • 7
  • 58
  • 86
FreeMan
  • 1,417
  • 14
  • 20

0 Answers0