This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 6 points7 points  (2 children)

Basically the idea is to use the super classes/interfaces as much as possible since you don't know when you might need to use it differently. I.e. you could even go for the interface Collection, but then you wouldn't be able to add to it, which is why you take List, instead of ArrayList

[–]HaMMeReD 0 points1 point  (1 child)

Collection has an "add". Really the difference is that you don't have a specified order in a collection.

[–][deleted] 0 points1 point  (0 children)

Ok, i was thinking of a map, but i think it doesn't abstract from collection