Why does ArrayList have "implements List"? [duplicate]
Solution 1:
Yes. It could've been omitted. But thus it is immediately visible that it is a List
. Otherwise an extra click through the code / documentation would be required. I think that's the reason - clarity.
And to add what Joeri Hendrickx commented - it is for the purpose of showing that ArrayList
implements List
. AbstractList
in the whole picture is just for convenience and to reduce code duplication between List
implementations.
Solution 2:
My 2 cents is to keep to the fact that ArrayList is a List. AbstractList just completes certain implementations that the List requires.
Solution 3:
Most likely this is to increase tracability of the inheritance structure. That way you don't have to go down the whole inheritance tree, when browsing the Javadoc or the like.