"the interface has defined the method as package-private"
All methods declared in interfaces are public by definition. There is no way around this.
This
interface Flyer{
void takeOff();
boolean land();
}
is equivalent to this
interface Flyer{
public void takeOff();
public boolean land();
}
This is illegal:
interface Flyer{
private void takeOff();
private boolean land();
}
as is this:
interface Flyer{
protected void takeOff();
protected boolean land();
}
Neither will compile.