Preventing Override With Final
easyQuestion 437The final specifier stops a virtual method from being overridden by any further subclass.
Base class Engine has a virtual method string start() const returning "engine".
Create a derived class V8Engine that overrides start() to return "V8 started" and marks it so no subclass of V8Engine can override it further. Use override final.
Called through an Engine* pointing to a V8Engine, the program prints the output shown in Expected Output.
Do NOT write a main function.
Expected output
V8 started= newline. The output ends with a newline, so print one after the last line.
Hints2 available
Sign in to use hintsTopics
Inheritance
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cout, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.