Take this test interface:
public interface DumbTestInterface<E> {
<T extends E> boolean addAll1(Collection<T> c);
boolean addAll2(Collection<? extends E> c);
}
Here's the byte code:
public abstract interface rumba.dumba.DumbTestInterface {
public abstract boolean addAll1(java.util.Collection arg0);
public abstract boolean addAll2(java.util.Collection arg0);
}
As you can see, there is no difference in the byte code received (except for the generated debug code). Therefore, if the two versions are equivalent, you can also stick to a version that is easier to understand.
source
share