Skip to content

Instantly share code, notes, and snippets.

@PhiHuyHoang
Created October 3, 2018 11:07
Show Gist options
  • Save PhiHuyHoang/ea7fa0d14df753d3984b4b5330e13332 to your computer and use it in GitHub Desktop.
Save PhiHuyHoang/ea7fa0d14df753d3984b4b5330e13332 to your computer and use it in GitHub Desktop.
interface RunMethod { void Go(); }
class Car : RunMethod
{
public void Go()
{
Console.WriteLine("I'm driving");
}
}
class Helicopter : RunMethod
{
public void Go()
{
Console.WriteLine("I'm flying");
}
}
class Program
{
static void Main(string[] args)
{
Car car = new Car();
Helicopter heli = new Helicopter();
car.Go();
heli.Go();
Console.ReadLine();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment