I have an interface VersionInterface which is implemented by my object ObjectDefinition
I also have a method that accepts two List<VersionInterface> as arguments.
Since ObjectDefinition implements VersionInterface, why can't I pass my two List<VersionInterface>as arguments to my method?
Method Definition:
public List<VersionInterface> updateArtifact(List<VersionInterface> currentCopy, List<VersionInterface> updatedCopy)
ObjectDefinition Definition:
public class ObjectDefinition implements VersionInterface {
How I'm calling updateArtifact:
service.updateArtifact(currentCopy, updatedCopy);
currentCopy and updatedCopy are both ArrayList<ObjectDefinition>
I get:
The method updateArtifact(List<VersionInterface>, List<VersionInterface>) in the type ORService is not applicable for the arguments (List<ObjectDefinition>, List<ObjectDefinition>)
Edit: My problem has to do with interfaces and not subclasses