โ Back to Inheritance
Question 545
Report Template Method
Report Template Method
Reportdefines the fixed methodGeneratethat wraps a body betweenSTARTandEND. It calls theabstractmethodBody, which subclasses fill in. ImplementBodyinSalesReportso it returns"sales: 100". Do NOT write aMainmethod. The program prints: START sales: 100 END
Expected Output:
START sales: 100 END
Topics:
Inheritance
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.