public static void Main() { var driverName = Console.ReadLine(); ICar ferarri = new Ferrari(driverName); Console.WriteLine(ferarri); 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"); } }
public static void Main() { string driverName = Console.ReadLine(); ICar car = new Ferrari(driverName, "488-Spider"); Console.Write($"{car.model}/"); car.Brakes(); Console.Write("/"); car.Gas(); Console.Write("/" + car.driverName); Console.WriteLine(); string ferrariName = typeof(Ferrari).Name; string iCarInterfaceName = typeof(ICar).Name; }
static void Main(string[] args) { var ferrari = new Ferrari(Console.ReadLine()); Console.WriteLine(ferrari); }
static void Main(string[] args) { string driver = Console.ReadLine(); Ferrari ferrari = new Ferrari(driver); }
static void Main(string[] args) { ICar driver = new Ferrari("George"); Console.WriteLine(driver.ToString()); }
public static void Main() { IFerrari ferrari = new Ferrari(Console.ReadLine()); Console.WriteLine(ferrari); }