Developing Java, you have always learned that its best to create an ArrayList by using the List interface as the type for the variable the list is stored in. Like this
List<String> myList = new ArrayList<String>();
However, by looking at a lot of the android examples that is included in the bundle, they have created the list by using the Class.
ArrayList<String> myList = new ArrayList<String>();
Is there any reason why this is done? Is it faster, lighter or something to explicitly setting the Class?
In resource constrained environment like the phones that Android are designed for, it’s preferrable to avoid using Interface, since it involves additional virtual function call.