Question: what is the difference between list l=new arraylist() and arraylist l=new arraylist()?
Answer: 3 Answers. When you declare List l = new ArrayList() l is limited to the methods provided by the interface List, while when you declare it ArrayList al = new ArrayList() it can use all methods and fields in an arraylist. ... As Chin Boon points out you can cast l to an ArrayList and thereby use methods of ArrayLists on it.