What is the difference between these two declarations:
ArrayList<String> arrayList = new ArrayList<String>();
List<String> arrayList = new ArrayList<String>();
List is an interface. ArrayList, LinkedList.. etc are classes which implement list. When you are using List Interface,you have to iterate elements using List-Iterator and can move forward and backward,in the List where as in ArrayList Iterate using Iterator and its elements can be accessed unidirectional way.
Let's see in Brief Explanation: