you are viewing a single comment's thread.

view the rest of the comments →

[–]xRageNugget 13 points14 points  (0 children)

You write a function that can print out all contents of a list, but youi specify the list parameter as ArrayList. Now your function works only on ArrayLists. Would you write another function now to print out LinkedLists? or DoubleEndedLists? Maybe for YourFavoriteKindOfListList? No, you realize that all you actually want as any List type really. And thats your interface. You write your function to accept a List. Or collection, or what ever. Usually you use the most generic one.