static void Main(string[] args) { String t = "afasdfsdaf"; Iphone iphone5 = new Iphone(); TeslaCar tesla = new TeslaCar(); iphone5.isOpen = true; iphone5.Texting(t); Console.WriteLine(tesla.Close()); }
public Car CreateCar(string carType) { Car car; if (carType.Equals("Benz")) { car = new BenzCar(); } else if (carType.Equals("Audi")) { car = new AudiCar(); } else { car = new TeslaCar(); } return(car); }