CJCoding With Joseph

Chain to the Base Constructor

Vehicle 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:

Toyota
4

Expected Output:

Toyota
4
Topics:
Polymorphism
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท 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.