List Interface Java

Being a sub interface of Collection inteface, List Interface utilizes all the methods of Collection interface. List Interface accepts duplicate elements. List interface comes with operations like:
  1. To manipulate elements by their numerical position in the list with the methods such as remove(), set(), add(), addAll() and get().
  2. To retrieve the numerical index number of an element present in the list with methods like indexOf() and lastIndexOf()./li>
  3. Apart using Iterator interface, it can also make use of ListIterator. ListIterator provides extra behaviour of adding and removing the elements etc./li>
  4. Operations on a range of elements can be done with subList() method./li>
More on List Interface is available at List Fundamentals.

Important implementations of List are ArrayList and LinkedList.

Leave a Comment

Your email address will not be published.