Redundant implementation of List interface in ArrayList.java

collections, java

Solution

Is there specific reason or requirement behind this

I don't think so. Removing the second `List<E>` would change absolutely nothing as far as the compiler is concerned.

My two hypotheses are:

- It's there for historic reasons. However, I can't find any evidence to support this.

- It's included for documentation purposes, to make it immediately clear than an `ArrayList<E>` is-a `List<E>` (this is probably the single most important thing to know about `ArrayList`).

Problem

Possible Duplicate: Why does ArrayList have “implements List”? I am new to java I was trying to see the hierarchy of collection interface. I found that the signature of AbstractList.java is like ``` public abstract class AbstractList<E> extends AbstractCollection<E> implements List<E> ``` It implements List interface. But if you look at signature of child class ArrayList.java it looks like ``` public class ArrayList<E> extends AbstractList<E> implements List<E>, RandomAccess, Cloneable, java.io.Serializable ``` If you look parent class is already implemented List interface then why child class is again implementing same interface (List). Is there specific reason or requirement behind this

Original source

Related problems