I have the following:
public class Helper {
public void doSomething(List<? extends MyClass> p1, Collection<? extends MyClass> c1) {
final <? extends MyClass> var1 = p1.get(0); // what should be here for the type ?
}
}
How can I make this work?
Thanks.
As mentioned elsewhere you can simply type the variable as MyClass, or you could write your code with reference to generic T like this