You can change the method to a parameterized (generic) method, ie.
private <T> method(Collection<T> s)
{
// Do something with s.
}
Regards,
nt
On May 20, 1:46 am, Zsolt Vasvari <[email protected]> wrote:
> private void method(Collection<String> s)
> {
> // Nothing
> }
>
> private void caller()
> {
> // Complies fine
> Collection<String> s = Collections.emptyList();
> method(s);
>
> // Doesn't compile -- gives error message
> // The method method(Collection<String>) in the type Import is
> not applicable for the arguments
> // (List<Object>)
> method(Collections.emptyList());
> }
>
> What's going on here? The two statements look identical to me...
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en