Harsha Smith wrote:You are not overloading the method here. Method Overloading mean same method name but different parameters. The return types can either be same or different.
Generics Type erasure. List<String> list and List<Integer> list are one and the same.
I see, thanks - not quite the same as what I'm used to. I would have thought that "List<String>" and "List<Integer>" were different - therefore method overloading would be possible.
I'll just rename my methods then.
Seems a little odd though that Java seems to be telling me that "List<String>" and "List<Integer>" are the same here, but if I try the following, Java tells me they are not the same!