(1) List<?> myList = new ArrayList<?>(); (2) ArrayList<?> myList = new ArrayList<?>();
I know that with (1) the implementations of the List interface can be swapped. It seems that (1) is typically used in applications regardless of need (I always use this myself).
Does anyone use (2)?
Also, how often does the situation actually require using (1) over (2) [i.e., where (2) wouldn't suffice..aside coding to interfaces and best practices, etc.]?
Please explain with an example