diff --git a/Lesson05/Lesson05/Program.cs b/Lesson05/Lesson05/Program.cs index e8c95d7..dc5f680 100644 --- a/Lesson05/Lesson05/Program.cs +++ b/Lesson05/Lesson05/Program.cs @@ -4,7 +4,44 @@ internal class Program { static void Main(string[] args) { - Console.WriteLine("Hello, World!"); + Person person = new Person(); + Display(person); + + Animal animal = new Animal(); + Display(animal); + + Cat cat = new Cat(); + Display(cat); } + + static void Display(IRunnable runnable) + { + runnable.Run(); + } + } + + interface IRunnable + { + public void Run(); + } + + class Person : IRunnable + { + public void Run() + { + Console.WriteLine("Person Running"); + } + } + + class Animal : IRunnable + { + public void Run() + { + Console.WriteLine("Animal running"); + } + } + + class Cat : IRunnable + { } } \ No newline at end of file