I have two files:
public interface PrintService {
void print(PrintDetails details);
class PrintDetails {
private String printTemplate;
}
public interface Task {
String ACTION = "print";
}
}
and
public class A implements PrintService {
void print(PrintDetails details) {
System.out.println("printing: " + details);
}
String action = PrintService.Task.ACTION;
}
I thought the code looks okay, but I am getting an error in the second file for the line void print(PrintDetails details) {
that states:
Cannot reduce the visibility of the inherited method from
PrintService
.
Can someone explain what this means for me?