Example & Tutorial understanding programming in easy ways.

What are the classes implementing List interface?


A List interface provides a collection of objects in insertion order, allow duplicates and none synchronized.
 
There are three classes that implement List interface:
1) ArrayList :

    It is a resizable array implementation.
    The size of the ArrayList can be increased dynamically at time of adding or deleting objects.
    The operations like add,remove and get can be formed once the object is created.
    It also ensures that the data is retrieved in the manner it was stored.
    The ArrayList is not thread-safe.


2) Vector:
It is thread-safe implementation of ArrayList. The methods are wrapped around a synchronized block.

3) LinkedList:
    The LinkedList also implements Queue interface and provide FIFO(First In First Out) operation for add operation.

It is faster if than ArrayList if it performs insertion and deletion of elements from the middle of a list.

Read More →