Possible Duplicate:
Why should the interface for a Java class be prefered?
ArrayList<Integer> al = new ArrayList<Integer>();
List<Integer> l = new ArrayList<Integer>();
what is the difference between these 2 lines? Is there any rules that I should use former one rather than later one in any case? Or vise versa? What is advantage or disadvantage of using particular one?
Thanks.