AP Comp Sci Practice Exam Question

<p>28) public interface TV
{
void tuneTo(String channel);
}</p>

<pre><code> public class MyTV implements TV
{
private ArrayList myFavoriteChannels;
public MyTV(ArrayList channels) { <code not shown>}
public void tuneTo(int k) { <code not shown>}
public void tuneTo(int k, String name) { <code not shown>}
}
</code></pre>

<p>One of them has one or more errors and won't compile properly. Which of the following best describes the compiler erros reported for the statements that are shown?
A) In the TV interface, the tuneTo declaration is missing the keyword public
B) MyTV should be declared abstract; it does not define tuneTo(String) in MyTV
C) tuneTo is defined more than once in MyTV
D) Cannot convert int to String in the tuneTo method in MyTV
E) Two errors: 1) tuneTo is defined more than once and 2) cannot convert int to String in the tuneTo(int) method in MyTV</p>

<p>I'm thinking it is either D or E.
Does anyone know if you can overload methods from interfaces?</p>

<p>I think it is D... If I remember correctly, interface methods may be overloaded provided the original method is implemented.</p>