fork(1) download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. Console.WriteLine(f(new Nullable<bool>()));
  8. Console.WriteLine(f(new Nullable<bool>(true)));
  9. Console.WriteLine(f(new Nullable<bool>(false)));
  10. }
  11. private static string f(bool? arg)
  12. {
  13. switch (arg)
  14. {
  15. case true: return "true";
  16. case false: return "false";
  17. case null: return "null";
  18. default: return "???";
  19. }
  20. }
  21.  
  22. }
Success #stdin #stdout 0.03s 36904KB
stdin
Standard input is empty
stdout
null
true
false