Veikedo

[C# interview] ExceptionHandling

Dec 7th, 2020
515
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.36 KB | None | 0 0
  1. //What will be in the output?
  2. using System;
  3.  
  4. class Program
  5. {
  6.     static void Main(string[] args)
  7.     {
  8.         try
  9.         {
  10.             Console.WriteLine("Hello");
  11.             return;
  12.         }
  13.         catch (ArgumentException)
  14.         {
  15.             Console.WriteLine("A");
  16.         }
  17.         catch (Exception)
  18.         {
  19.             Console.WriteLine("B");
  20.         }
  21.         finally
  22.         {
  23.             Console.WriteLine("C");
  24.         }
  25.  
  26.         Console.ReadLine();
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment