Relates :
|
MyClass is rejected by javac with the following error: incompatible types found : java.util.Collection<java.lang.String> required: java.util.Collection<java.lang.Object> ----------------------------------------------------------------------- import java.util.Collection; public class MyClass { public static <E, F extends E> Collection<E> foo(F val) { return null; } public static void tryIt() { Collection<Object> obj = foo("bar"); } }