1. Write the first line of the definition for a Stereo class. The class should extend the
SoundSystem class, and it should implement the CDplayable, TunerPlayable, and
CassettePlayable interfaces.
2. Write an interface named Nameable that specifies the following methods:
public void setName(String n)
public String getName()
3. Look at the following interface:
public interface Computable
{
double compute(double x);
}
Write a statement that uses a lambda expression to create an object that implements the Computable interface. The object’s name should be half. The half object’s compute method should return the value of the x parameter divided by 2.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here