Chain to the Base Constructor
easyQuestion 783Vehicle has a constructor that takes a make and stores it in Make. Complete the Car constructor so it forwards make up to the base Vehicle constructor using : base(...), then stores doors in Doors. The tester builds a Car and prints its Make on the first line and its Doors on the second. Do NOT write a Main method.
For new Car("Toyota", 4) the program prints the output shown in Expected Output.
Expected output
Toyota 4
= newline. The output ends with a newline, so print one after the last line.
Hints2 available
Sign in to use hintsTopics
Polymorphism
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cw, cr, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.