Regardless of the type of communications device, there must be a way to transmit and receive data. Define an interface, CommDevice, with two methods : transmit, that accepts two parameters — reference to a Destination object , and a string (in that order), and returns a boolean; and receive, that accepts a parameter of type Duration, and returns a reference to a String.
LANGUAGE: JAVA
CHALLENGE:
Regardless of the type of communications device, there must be a way to transmit and receive data. Define an interface, CommDevice, with two methods : transmit, that accepts two parameters — reference to a Destination object , and a string (in that order), and returns a boolean; and receive, that accepts a parameter of type Duration, and returns a reference to a String.
SOLUTION:
interface CommDevice { public boolean transmit( Destination d, String s); public String receive( Duration d ); }