I have a method that receives 2 parameters: List of interface. I get an error when I try to call this method with List of class that implements that interface.
The input must be of type class, I don't want to change it to List of interface.
List<Io> oldList;
List<Io> newList;
handleIo(oldList, newList); //Here I get the error
public void handleIo(List<IIo> oldIos, List<IIo> newIos) {...}
public class Io implements IIo {...}
public interface IIo {...}
I thought this is the idea of interfaces, I can't figure out what is wrong. The error asking to change the type of the parameters I send to the method.