0

Java's JList is now parameterized, and parameterization was first introduced in Java 1.7: type JList does not take parameter type <String>

Why doesn't this class parameterization break compatibility with applications that have been compiled with a Java 1.6 compiler but are running on a Java 1.7 JRE? I would naturally assume that when so fundamental as the amount of type parameters a class takes has been changed, the compatibility would break.

Similar question (probably has the same answer): ExecutorService's invokeAll took in Java 1.5 Collection<Callable<T>>, but now it takes Collection<? extends Callable<T>>. Why doesn't this break binary compatibility?

Related: What is binary compatibility in Java?

juhist
  • 4,210
  • 16
  • 33

1 Answers1

2

Quoting JLS Sec 13.4.5:

Adding or removing a type parameter of a class does not, in itself, have any implications for binary compatibility.

Andy Turner
  • 137,514
  • 11
  • 162
  • 243