Forum Stats

  • 3,837,921 Users
  • 2,262,309 Discussions
  • 7,900,433 Comments

Discussions

Why the ArrayList implements the List interface

902443
902443 Member Posts: 1
Why the ArrayList implements the List interface even though it extends the AbstractList class. Is it only for clarity of interface implemented?

Answers

  • 825535
    825535 Member Posts: 27
    899440 wrote:
    Why the ArrayList implements the List interface even though it extends the AbstractList class. Is it only for clarity of interface implemented?
    I dont think there's any specific reason for that. In my opinion its redundant. May be its added for clarity so that from the documentation its obivous that ArrayList implements List.
    May be there's something which I am missing regarding this?
  • EJP
    EJP Member Posts: 32,920 Gold Crown
    Javadoc would show it as implementing List even if that was only inherited. Whether or not to reiterate the implemented interfaces is a never ending debate. It is redundant: it does no harm.
This discussion has been closed.