โ Back to Classes
Question 142
BusPass toString
BusPass toString
Create a class BusPass that extends TransitPass and adds a String zone field. Override toString() to return the base TransitPass string plus the zone, like: "Transit Pass: 2.0 - Zone A". Use super.toString() to start the string. Do NOT write a main method.
Expected Output:
Transit Pass: 2.0 - Zone A
Topics:
Classes
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.