I'm a beginner in Java. From my understanding, when we use any Collections in Java, we declare data type between the tag. However, I'm confused why we would use an Interface as data type for a collection, for example a list as shown below.
List<Type> list3 = new ArrayList<Type>();
List<Interface> list3 = new ArrayList<Interface>();
Appreciate your help. Thank you.