I have a problem in my Java code. I have four (important) classes:
public class RDOutput extends OutputType public class RDAnalysis extends AnalysisProperties
Now I'm trying to create a method in the Analysis properties:
public abstract void display(ArrayList<? extends OutputType> results);
In the main list of problems, objects in ArrayList will be different subtypes of OutputType. In my RDAnalysis class, I am trying to do a specific override:
public void display(ArrayList<RDOutput> results) {
but eclipse says: name collision: mapping a method (ArrayList) of type RDAnalysis has the same erasure as mapping (ArrayList? extends OutputType) of type AnalysisProperties, but does not cancel it
I am not familiar with Java tricks, I tried to search the documentation and I did not find a solution to this problem. My question is: is this a trick I'm doing (base type in abstract and extended in final function) possible in Java (if so, how can I do this?) Or do I need to do some enumerations to solve this problem?
source share