Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 38 additions & 1 deletion Lesson05/Lesson05/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
}
}