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

  1. Declare void print() method in Printable interface
  2. Document class implements Printable and prints Printing document... in print()
  3. In main, create a Document object and call print()

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