public interface ICanTravelThroughTheAir
{
}
public class Flea : ICanTravelThroughTheAir
{
}
public class AircraftCarrier
{
private readonly List<ICanTravelThroughTheAir> _aircraft = new();
public void AddAircraft(ICanTravelThroughTheAir flyingThing)
{
_aircraft.Add(flyingThing);
}
}
public class Dog : AircraftCarrier
{
public void Woof()
{
Console.WriteLine("Bitch I'm an aircraft carrier!");
}
}
public static class Program
{
public int Main(string[] args)
{
var dog = new Dog();
for (var i = 0; i < 10000; i++)
{
dog.AddAircraft(new Flea());
}
dog.Woof();
}
}
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
replies: