Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
"It's not enough that we do our best; sometimes we have to do<br />what's required."<br /> <br />-- Sir Winston Churchill
"It's not enough that we do our best; sometimes we have to do<br />what's required."<br /> <br />-- Sir Winston Churchill
Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
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?
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
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?
"It's not enough that we do our best; sometimes we have to do<br />what's required."<br /> <br />-- Sir Winston Churchill
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.
"It's not enough that we do our best; sometimes we have to do<br />what's required."<br /> <br />-- Sir Winston Churchill
I will open the floodgates of his own worst nightmare! All in a tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
|