Solved

Consider the Following Class

Question 28

Essay

Consider the following class:
public class Radio
{
private double frequency;
private String name;
// overloaded constructor
// accessors (get methods)
// mutators (set methods)
// other methods
}
Code the two mutators. Frequency must be between 80 and 110 included. If the parameter is out of that range, set the frequency to 100. There is no constraint on name. The mutators should return the Radio reference that calls them.
// Your code goes here

Correct Answer:

verifed

Verified

public Radio setFrequency( double newFre...

View Answer

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions