Code similar to the following is often used in Java programming,
New Arraylist<string> ();
Just know that this is polymorphic, like a specification and somehow.
Programming for a supertype (parent class), which means that the declared type of a variable (or the return type of the method) is a supertype, not a specific subclass. The specific implementations of each method in the superclass are not in the superclass, but in each subclass. This allows you to perform a real (one subclass) behavior based on the actual condition when the program executes. The benefit is that when declaring a variable, we don't have to worry about what the actual data type is (a subclass type) at the time of execution, which is the idea of decoupling (loose coupling). We can replace the declared variable at any time after we maintain it with the type that really needs to be executed, if in the above code when want to swap with LinkedList to implement this function, the other code does not change, only need to change this line, because the interface declares the method that the subclass common. It has high maintainability and scalability. So in fact, we can also change the phrase: "For the Super Type Programming", the super-type is usually an interface or an abstract class.
In fact, this is for interface programming (Interface-oriented programming), which separates the design from the implementation. In an object-oriented system, the various functions of the system are accomplished by many different objects. In this case, it is not so important for the system designers to implement their own internal objects, but the collaboration between the objects becomes the key of the system design. Small to different classes of communication, large to the interaction between the modules, at the beginning of the system design is to focus on, which is the main work of the system design.
More specific explanations refer to: http://toyota2006.iteye.com/blog/25232?yyue=a21bo.50862.201879
From Java small example to programming for (oriented) interfaces