Why are the angle brackets before the return type omitted sometimes from the definition of a generic method
问题 I was reading Effective Java chapter 5 about generics, in particular the items on preferring generic methods. I noticed that sometimes the type parameter(between angle brackets) in the method declaration before the return type is sometimes omitted. There are many cases like that, but for example on page 135 of the second edition: public void popAll(Collection<E> dst) { while (!isEmpty()) dst.add(pop()); } On the other hand, I have seen similar generic methods with the declaration public <E>