• Source
    1. using System;
    2.  
    3. namespace Nullable
    4. {
    5. class MainApp
    6. {
    7. static void Main(string[] args)
    8. {
    9. int? a = null;
    10.  
    11. Console.WriteLine(a.HasValue);
    12. Console.WriteLine(a==null);
    13.  
    14. a = 3;
    15. Console.WriteLine(a.HasValue);
    16. Console.WriteLine(a!= null);
    17. Console.WriteLine(a.Value);
    18.  
    19. }
    20. }
    21. }
    22.