Challenge 2: Implement the Parametrized Constructor

Can you implement the Derived Class Parametrized constructor? A solution is placed in the "solution" section to help you, but we would suggest you try to solve it on your own first.

Problem Statement

Implement the constructor Dell(String name) of the Derived Class Dell which takes a string, name. We have already implemented the Base Class Laptop with the member function getName() and a parameterized constructor.

Input

Laptop name is being passed through the parameterized constructor.

Output

getName() method is returing Laptop name.

Sample Input

        Dell dell = new Dell("Dell Inspiron");

Sample Output

        "Dell Inspiron" 

Get hands-on with 1200+ tech skills courses.