fork(1) download
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. class Program {
  5. static void Main() {
  6. Console.WriteLine(HasItem(new List<string>(), null));
  7. try {
  8. Console.WriteLine(HasItem(new SortedList<string, int>().Keys, null));
  9. } catch (ArgumentNullException) {
  10. Console.WriteLine("ArgumentNullException");
  11. }
  12. }
  13.  
  14. public static bool HasItem(ICollection<string> collection, string item) {
  15. return collection.Contains(item);
  16. }
  17. }
Success #stdin #stdout 0.05s 24072KB
stdin
Standard input is empty
stdout
False
ArgumentNullException