180k views
2 votes
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.

User SstrykerR
by
5.3k points

1 Answer

3 votes

Answer:

abstract interface CommDevice {

public abstract boolean transmit(Destination a, String b);

public abstract String receive(Duration a);

}

Step-by-step explanation:

Line 1 of the above codes starts with defining the interface CommDevice that will accept two methods transmit and receive. The parameters of the method 'transmit' in the above code are (Destination a, String b). The boolean in line 2 of the code will ensure that the method returns a boolean.

The parameters of the second method 'receive' in the above code is (Duration a) which will then return the reference to a string as indicated in line 3 of the code.

User Caduceus
by
6.5k points