Inherit and Call Super Method
easyQuestion 195A Vehicle class is provided with a method describe() that returns "I am a vehicle". Complete the Truck class that extends Vehicle.
Requirements:
1. Override describe() to return the parent's description followed by " - specifically a truck". You must call super.describe() to get the parent's text.
So the final output of describe() should be: "I am a vehicle - specifically a truck".
Do NOT write a main method.
Expected output
I am a vehicle - specifically a truck= newline. The output ends with a newline, so print one after the last line.
Hints2 available
Sign in to use hintsTopics
InheritanceClasses
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (sysout, psvm, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.