fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace laba_5
  8. {
  9. public interface IA
  10. {
  11. void mIA();
  12. }
  13.  
  14. public interface IC : IA
  15. {
  16. void met();
  17. }
  18.  
  19. public class B : IA
  20. {
  21. public void met()
  22. {
  23. Console.WriteLine("method of B");
  24. }
  25.  
  26. public void mIA()
  27. {
  28. Console.WriteLine("method of IA");
  29. }
  30. }
  31.  
  32. public class D : B, IC
  33. {
  34. public void mD()
  35. {
  36. Console.WriteLine("method of D");
  37. }
  38.  
  39. public void met()
  40. {
  41. Console.WriteLine("method of IC");
  42. }
  43. }
  44. /*
  45.   D
  46.   / \
  47.   B IC
  48.   \ /
  49.   IA
  50.   */
  51.  
  52. class Program
  53. {
  54. static void Main(string[] args)
  55. {
  56. IC d=new D();
  57. d.met();
  58. ((B)d).met();
  59. Console.ReadKey();
  60. }
  61. }
  62. }
Success #stdin #stdout 0.02s 15848KB
stdin
Standard input is empty
stdout
method of IC
method of B