fork(1) download
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. interface IX
  5. {
  6. void X();
  7. }
  8.  
  9. class XA : IX
  10. {
  11. public void X() { Console.WriteLine("XA.X()"); }
  12. }
  13.  
  14. static class XExtensions
  15. {
  16. public static void X(this IEnumerable<IX> xList)
  17. {
  18. foreach (var x in xList)
  19. {
  20. x.X();
  21. }
  22. }
  23. }
  24.  
  25. public class Program
  26. {
  27. public static void Main(string[] args)
  28. {
  29. var xaArray = new[] { new XA() };
  30. xaArray.X();
  31. }
  32. }
  33.  
Success #stdin #stdout 0.02s 34808KB
stdin
Standard input is empty
stdout
XA.X()