Advertisement
Guest User

c# crazyness

a guest
Jan 18th, 2016
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.75 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication1
  8. {
  9.     static class Ext
  10.     {
  11.         public static bool Greater0(this int a)
  12.         {
  13.             return a > 0;
  14.         }
  15.     }
  16.     class Program
  17.     {
  18.  
  19.         class Hugo {
  20.             public Hugo() { }
  21.             public int value = 0;
  22.         }
  23.  
  24.  
  25.         static void Main(string[] args)
  26.  
  27.         {
  28.             Hugo nullHugo = null;
  29.  
  30.             var what1 = nullHugo?.value;
  31.             var what2 = what1?.GetHashCode();
  32.             var what3 = nullHugo?.value > 0;
  33.             var what4 = what1?.Greater0();
  34.             Console.WriteLine(what1 > 0 || what1 <= 0);
  35.         }
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement