I had an interview days ago and was thrown a question like this.
Q: Reverse a linked list. Following code is given:
public class ReverseList {
i
This is called programming to interfaces. You don't code to a specific implementation class of node lists but to the interface implemented by all those implementations.
That way your code will still work if someone writes a new and much better implementation of NodeList after you wrote your reverse method and you don't have to adapt your code for each new implementation of NodeList.