In the following example:
interface I {
int F = 1;
}
class A extends B implements I { ... }
class B implements I { ... }
the implements I on class A is redundant. If I remove it, does it break binary compatibility?
Background of the question: If I call getFields() on class A, I get the public field F from the interface I, but if I remove the redundant implements I, I no longer get field F.
Let's add a class C to the example. So you have
I rearranged them so the superclass is on top.
Since the superclass B implements I, and C is similar to B I'd expect that it also implements I. With that, the
implements Ion class A should be redundant and can be removed.On the other hand, if you remove the
implements Ion class B, it would have impact on C which also would no longer implement I. So theimplements Ion B is not redundant, as it mandates that B and all subclasses do implement I.