Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following code: public interface Vocaloid { void applyFilter ( Filter f ) ; void sing ( ) ; void adlib ( ) ;

Consider the following code:
public interface Vocaloid {
void applyFilter(Filter f);
void sing();
void adlib();
void callAndResponse();
}
public class HatsuneMiku implements Vocaloid {
void applyFilter(Filter f){
filter.apply(this);
}
void sing(){
}
System.out.println("Hatsune Miku sings");
String adlib(int seed){
System.out.println("Hatsune Miku adlibs with seed "+ seed);
}
void callAndResponse(){
System.out.println("Miku calls for a response");
}
}
Which method does need to implement in order to compile?
void adlib()
String toString()
boolean equals()
The class
compiles without any changes.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

e. What are notable achievements of the group?

Answered: 1 week ago