fork(1) download
  1. using System;
  2.  
  3. interface Device1
  4. {
  5. void start();
  6. }
  7.  
  8. interface Device2
  9. {
  10. void start();
  11. }
  12.  
  13. public class ConcreteDevice : Device1, Device2
  14. {
  15. void Device1.start()
  16. {
  17. Console.WriteLine("Device1 implementation");
  18. }
  19.  
  20. void Device2.start()
  21. {
  22. Console.WriteLine("Device2 implementation");
  23. }
  24.  
  25. }
  26.  
  27. public class Test
  28. {
  29. public static void Main()
  30. {
  31. Device1 d1 = new ConcreteDevice();
  32. Device2 d2 = new ConcreteDevice();
  33.  
  34. d1.start();
  35. d2.start();
  36. }
  37. }
Success #stdin #stdout 0.02s 15948KB
stdin
Standard input is empty
stdout
Device1 implementation
Device2 implementation