Originally posted by Sreedevi Vinod:
But just by looking at the declaration, doesn't it specify that the array element and Collection element are of the same type T?
That is: allow the call if parameters are Integer, ArrayList<Integer> , but reject call if paramters are Integer, ArrayList<Number>. The programmer has specified that he wants the former, not the latter.
Originally posted by Ken Blair:
Because the former is the latter by definition if the former is a subtype of the latter?
Originally posted by Akshay Kiran:
Ken don't be confused, Barry was citing that "it doesn't work that way" as you're thinking it does.
fromArrayToList(Integer, ArrayList<Number> actually works and that is the whole point that is being mooted.