CJCoding With Joseph
15free / daySign inCreate account

Transport is an abstract class with two abstract methods and one finished method, describe(), that calls both of them. A subclass can only be created once it gives every abstract method a body. Complete Motorbike.

Requirements: 1. wheels() returns 2. 2. fuel() returns electricity when the electric field is true and petrol otherwise. 3. Leave describe() alone. It is inherited and works as soon as both methods return real values.

Do not change the Transport class.

Do NOT write a main method.

Expected output

2
petrol
2 wheels, runs on petrol

= newline. The output ends with a newline, so print one after the last line.

Hints4 available
Topics
Abstract ClassesClasses
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.