fork download
  1. using System;
  2.  
  3. namespace AbstractFactory
  4. {
  5. interface IContinent
  6. {
  7.  
  8. }
  9.  
  10. interface IWolf
  11. {
  12. public string Name { get; set; }
  13. void Attack();
  14. }
  15. interface ITiger
  16. {
  17. public string Name { get; set; }
  18. void Attack();
  19. }
  20. interface IElephant
  21. {
  22. public string Name { get; set; }
  23. void Move();
  24. }
  25.  
  26. class Wolf : IWolf
  27. {
  28. public string Name { get; set; } = "Wolf";
  29.  
  30. public void Attack()
  31. {
  32. Console.WriteLine($"{Name} is attacking ");
  33. }
  34. }
  35.  
  36. class Tiger : ITiger
  37. {
  38. public string Name { get; set; } = "Tiger";
  39.  
  40. public void Attack()
  41. {
  42. Console.WriteLine($"{Name} is attacking ");
  43. }
  44. }
  45.  
  46. class Elephant : IElephant
  47. {
  48. public string Name { get; set; } = "Elephant";
  49.  
  50. public void Move()
  51. {
  52. Console.WriteLine($"{Name} is moving");
  53. }
  54. }
  55.  
  56. class Giraffe : IGiraffe
  57. {
  58. public string Name { get; set; } = "Giraffe";
  59.  
  60. public void Move()
  61. {
  62. Console.WriteLine($"{Name} is moving ");
  63. }
  64. }
  65.  
  66. interface IGiraffe
  67. {
  68. public string Name { get; set; }
  69. void Move();
  70. }
  71.  
  72. class PredatoryAnimal : IContinent
  73. {
  74.  
  75. }
  76. class Program
  77. {
  78. static void Main(string[] args)
  79. {
  80.  
  81. }
  82. }
  83. }
  84.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(12,23): error CS0106: The modifier `public' is not valid for this item
prog.cs(17,23): error CS0106: The modifier `public' is not valid for this item
prog.cs(22,23): error CS0106: The modifier `public' is not valid for this item
prog.cs(68,23): error CS0106: The modifier `public' is not valid for this item
Compilation failed: 4 error(s), 0 warnings
stdout
Standard output is empty