Advertisement
Guest User

Untitled

a guest
Jun 6th, 2011
990
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.73 KB | None | 0 0
  1. using System;
  2.  
  3. internal class Test
  4. {
  5.     private static int? a;
  6.  
  7.     private static int? A
  8.     {
  9.         get { Console.WriteLine("A Accessed"); return a; }
  10.         set { a = value; }
  11.     }
  12.  
  13.     private static int? b;
  14.  
  15.     private static int? B
  16.     {
  17.         get { Console.WriteLine("B Accessed"); return b; }
  18.         set { b = value; }
  19.     }
  20.  
  21.     private static int? c;
  22.  
  23.     private static int? C
  24.     {
  25.         get { Console.WriteLine("C Accessed"); return c; }
  26.         set { c = value; }
  27.     }
  28.  
  29.     //public int? testing { get; set; }
  30.  
  31.     private static void Main()
  32.     {
  33.         Console.WriteLine("First case");
  34.  
  35.         A = 4;
  36.         B = 4;
  37.         c = 4;
  38.  
  39.         int? something2 = (A ?? B) ?? C;
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement