• Post Reply Bookmark Topic Watch Topic
  • New Topic

Why does the ArrayList class implements List interface?  RSS feed

 
Girish K Gupta
Greenhorn
Posts: 19
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why does the java.util.ArrayList class implements java.util.List interface?
As we know that ArrayList extends from java.util.AbstractList which already implements the List interface?
Is it a mistake or conscious design decision?

Regards
Girish K Gupta
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Probably just for documentation purposes, to make it clear for people who want to use ArrayList.

It is indeed redundant, since the AbstractList superclass of ArrayList already implements the List interface.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!