Diagramming an interface, a field and a parameter

Consider the Java code below, where Customer and Printer are classes defined elsewhere in the same program. When each relationship in this code is drawn as a line on the class diagram, which statements are true? Select all that apply.


Java
public interface Payable {
    double amountDue();
}

public class Invoice implements Payable {
    private Customer customer;
    private double total;
    public double amountDue() { return total; }
    public void print(Printer p) { p.send(this); }
}
Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More UML Class Diagrams Questions: