TheBulgarianWolf

Thread Exception Handling

Nov 21st, 2020
728
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.46 KB | None | 0 0
  1. using System;
  2. using System.Threading;
  3.  
  4. namespace MoreMethodExercises
  5. {
  6.     class Program
  7.     {
  8.         static void Main()
  9.         {
  10.             try
  11.             {
  12.                 new Thread(Go).Start();
  13.             }
  14.             catch
  15.             {
  16.                 Console.WriteLine("Exception!");
  17.             }
  18.            
  19.                
  20.         }
  21.  
  22.         static void Go()
  23.         {
  24.             throw null;
  25.         }
  26.        
  27.     }
  28. }
  29.  
Add Comment
Please, Sign In to add comment