-1

I see the following class hierarch, for LinkedList in Java.

public interface Collection<E>
extends Iterable<E>


public abstract class AbstractCollection<E>
extends Object
implements Collection<E>


public abstract class AbstractList<E>
extends AbstractCollection<E>
implements List<E>

public abstract class AbstractSequentialList<E>
extends AbstractList<E>

public class LinkedList<E>
extends AbstractSequentialList<E>
implements List<E>, Deque<E>, Cloneable, Serializable

Observing this hierarchy, why LinkedList need to mention implements List<E> when it is indirectly coming from AbstractList<E>.

Is there any reason to do so?

EDIT

Screenshotenter image description here of the actual code (from rt.jar)

CuriousMind
  • 8,301
  • 22
  • 65
  • 134

1 Answers1

2

No, it has no impact in terms of language semantics in this case. I imagine they just put it to make it clearer that it implements List as well, without the developer having to traverse the full hierarchy.

Hari Menon
  • 33,649
  • 14
  • 85
  • 108