Q9. Given the following code:
abstract class Device{
String name;
String number;
String address;
int frequency;
abstract void setName(String name);
abstract void connect();
abstract void disconnect();
abstract void call(String number);
abstract void listenOn(int frequency);
}
interface Caller{ }
interface Receiver{ }
class Phone extends Device implements Caller{ }
class TV extends Device implements Receiver{ }
class WalkieTalkie extends Device implements Caller, Receiver{ }
and the following requirements specification regarding the call and listenOn functionality:
1. Phone supports only the call operation. Users should have the ability to call a number, but not set the frequencey. Assume frequency is fixed at 0.
2. TV supports only the listenOn operation. Users should have the ability to set the frequency using the listenOn method, but not change the number. Assume number is fixed at "0".
3. WalkieTalkie contains both call and listenOn features. Users should have the ability to call a number using call as well as set frequency using listenOn.
The methods setName, connect, and disconnect are applicable to Phone, TV, and WalkieTalkie.
Which two changes together would allow you to achieve these specifications?
Select 2 option(s):