I got a question in my mind that:
What the difference
1) List list = new ArrayList()
2) List list = new LinkedList() ?
No matter I initialize list in the both way above, still it can only use method in List, but not either ArrayList or LinkedList, isn't it?
I read from a website (http://www.corejavaguru.com/blog/java/new-arraylist), stated that it is known as "programming to an interface", which easy for a developer to change from ArrayList to LinkedList or vice versa in future. But no way for me to use method of ArrayList/LinkedList if I initialized in the way shown above, even it is flexible to change the way of initialize. I believe there is a reason. Hope to find answer for it.