Robert

58%
Flag icon
The confusing behavior demonstrated by the previous example came about because the List<E> interface has two overloadings of the remove method: remove(E) and remove(int). Prior to Java 5 when the List interface was “generified,” it had a remove(Object) method in place of remove(E), and the corresponding parameter types, Object and int, were radically different.
Robert
The problem isn't that these two overloadings have the same number of parameters (well, it's a secondary problem), but that two very different operations were given the same name.
Effective Java
Rate this book
Clear rating
Open Preview