Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hi All. I have a question about the java interface signature. I wasgiven the fol

ID: 3617258 • Letter: H

Question

Hi All.
I have a question about the java interface signature. I wasgiven the following code

public interface Top-N {
      public Set<Tuple> topN(stringQ,int K, Score F)
}

public class TopNImpl implements TopN{
      public Set<Tuple> topN(stringQ, int K, Score F)
}

I am not sure what the Set<tuple> is used for in interfacesignature definition. Is this a way to inherit all thefunctionality from class Tuple?

I have a class Tuple defined
and an interface Score and ScoreImpl

Any help would be appreciated. Thx.

Explanation / Answer

publicinterface TopN { publicSettopN(String Q,int K, Score F) } The Setis the return type of the method. When you implement it, you will need to return a Set. public class TopNImplimplements TopN { publicSettopN(String Q, int K, Score F){returnnull;} }