Java generic interfaces with typesafe implementations
Date : March 29 2020, 07:55 AM
I hope this helps you . It works if you make the type of Component into a type variable for ReportBuilder: public interface ReportBuilder<T extends Component> {
public Report buildReport(List<T> components);
}
public class PDFReportBuilder implements ReportBuilder<PDFComponent> {
public Report buildReport(List<PDFComponent> components);
}
|
Java: calling Interfaces without assigning implementations
Date : March 29 2020, 07:55 AM
fixed the issue. Will look into that further The implementation needs to be alwasy provided somehow. But the decission about which implementation will be used could be postponed to runtime using "Direct Injection".
|
Why do Java interfaces have method implementations?
Date : March 29 2020, 07:55 AM
|
Why java interfaces can't contain static methods implementations?
Date : March 29 2020, 07:55 AM
|
How can I create implementations of interfaces, that are use specific implementations of other interfaces?
Date : March 29 2020, 07:55 AM
|