fork(1) download
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4.  
  5. public class Test
  6. {
  7. public static void Main()
  8. {
  9. List<int> l = new List<int>();
  10. Console.WriteLine(".Count = {0}", l.Count);
  11. Console.WriteLine("Type = {0}", GetListType(l));
  12. }
  13.  
  14. static Type GetListType(IEnumerable list)
  15. {
  16. return list.GetType().GetGenericArguments()[0];
  17. }
  18. }
Success #stdin #stdout 0.03s 33864KB
stdin
Standard input is empty
stdout
.Count = 0
Type = System.Int32