Solution Review: Implement the Parametrized Constructor
This review provides a detailed analysis on how to solve the 'Implement the Parametrized Constructor' challenge.
We'll cover the following...
Solution
Press + to interact
// Base Classclass Laptop {// Private Data Memberspublic string Name{get; set;}public Laptop() { // Default Constructor}public Laptop(string name) { // Default Constructorthis.Name = name;}}// Derived Classclass Dell : Laptop {public Dell(string name): base(name){}}class Demo {public static void Main(string[] args) {Dell dell = new Dell("Dell Inspiron");Console.WriteLine(dell.Name);}}