017-001-007
Basic Interface Definition
Easy
Problem Description
Basic Interface Definition
In this problem, you will create a program that declares a Printable interface, implements it in a Document class, and displays the result of calling the print() method to standard output.
Learning Objective: Understand the basic syntax of declaring and implementing interfaces
Overview
Define a Printable interface and implement it in a Document class.
Specifications
- Declare
void print()method inPrintableinterface Documentclass implementsPrintableand printsPrinting document...inprint()- In main, create a
Documentobject and callprint()
Output Format
Printing document...
Ready to Try Running Code?
Log in to access the code editor and execute your solutions for this problem.
Don't have an account?
Sign Up