Created
June 1, 2021 08:53
-
-
Save ssukhpinder/67b05ce9925c8dd657c11289089613ec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void Main(string[] args) | |
{ | |
var sedan = new ModelSedan(); | |
var suv = new ModelSuv(); | |
var factory = new CarFactory(); | |
var builders = new List<CarBuilder> { suv, sedan }; | |
foreach (var b in builders) | |
{ | |
var c = factory.Build(b); | |
Console.WriteLine($"The Car details" + | |
$"\n--------------------------------------" + | |
$"\nName: {c.Name}" + | |
$"\nIs SUV: {c.IsSUV}" + | |
$"\nTop Speed: {c.TopSpeed} mph\n"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment