I must have missed something regarding generics in Java, but why does this not work?
List<String> list = new ArrayList<String>();
cannot be sent to:
method( List<Object> );
But it does not work? How come?
But if the method was:
method( Object o )
it can be used with:
method( new String("hello") )
without any problems
q1) String does extend Object, why cannot it be passed to?
List<Object>
q2) and why does
method( List<? extends Object> )
work? What's the difference?