posted 13 years ago
This question has been ask a LOT before...if you searched, you probably would have already found the answer.
In brief, it lets you be more flexible in how you write code. It shouldn't matter to me if the data is stored as a linked list, a hash table, an array, or something else. All i want to do is getNextElement(). If I write my code to use the interface, I can change the underlying data structure as much as I want, as long as it still implements the interface and has a getNextelement() method.
Search this forum for more posts on this same topic, and you'll find more detail.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors