According to my use-case, I have a class myClass implementing an interface myInterface.
public class MyClass implementing MyInterface{
...
}
I have got a method which has List as parameter.
myMethod(List<MyClass> listOfMyClass){
...
// want to make a call to third party API which has List<MyInterface>
thirdPartyAPI(listOfMyClass);
}
thirdPartyAPI(List<MyInterface> listOfMyInterface){
...
}
In the above case, I want to use listOfMyClass in calling #thirdPartyAPI. Currently, I got "The method myMethod(List) is not applicable for arguments thirdPartyAPI(List).Let me know if I need to update my design or approach. Any help will be appreciated. Thanks.
Been through Java Generics -- Assigning a list of subclass to a list of superclass but didn't help my case.