Csharp/C Sharp by API/System/StackOverflowException

Материал из .Net Framework эксперт
Перейти к: навигация, поиск

StackOverflowException.Message

<source lang="csharp">

using System;

class MainClass {

   public static void Main()
   {
       try
       {
           Recursive();
       }
       catch(StackOverflowException)
       {
           Console.WriteLine("The CLR is out of stack space.");
       }
   }
  
   public static void Recursive()
   {
       Recursive();
   }

}


 </source>