Пример #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            IVehicle bmw = new Bmw();

            bmw.DefaultMessage();

            IVehicle audi = new Audi();

            audi.DefaultMessage();
        }
Пример #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            IVehicle bmw = new Bmw();

            bmw.DefaultMessage();

            IVehicle audi = new Audi();

            audi.DefaultMessage();

            // Default interfaces enable the traits programming pattern? https://en.wikipedia.org/wiki/Trait_(computer_programming)
            // For more info and examples on traits see also the rust programming language which uses traits instead of inheritance: https://doc.rust-lang.org/book/ch10-02-traits.html
        }