Beispiel #1
0
    static void Main(string[] args)
    {
        string name    = Console.ReadLine();
        ICar   ferrari = new Ferrari("488-Spider");

        Console.Write(ferrari.Model);
        ferrari.Brakes();
        ferrari.GasPedal();
        Console.Write(name);
    }
Beispiel #2
0
    public static void Main()
    {
        var  driverName = Console.ReadLine();
        var  model      = "488-Spider";
        ICar ferrari    = new Ferrari();

        Console.WriteLine($"{model}/{ferrari.UseBrakes()}/{ferrari.GasPedal()}/{driverName}");

        string ferrariName       = typeof(Ferrari).Name;
        string iCarInterfaceName = typeof(ICar).Name;

        bool isCreated = typeof(ICar).IsInterface;

        if (!isCreated)
        {
            throw new Exception("No interface ICar was created");
        }
    }