CJCoding With Joseph
15per day

Inherit and Call Super Method

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