โ Back to Interfaces
Question 629
Interface Method Returning a Formatted String
Interface Method Returning a Formatted String
TheIMovableinterface declaresstring Move(int distance). Complete theCarclass soMovereturns the textMoved N meters, whereNis the distance passed in. Do NOT write aMainmethod. ForMove(10)the program prints: Moved 10 meters
Expected Output:
Moved 10 meters
Topics:
Interfaces
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.