Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

comparison of List & ArrayList

 
k sabeerdeen
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi experts,

what is the difference between the two :

List list= new ArrayList();

ArrayList list = new ArrayList();

thanks in advace!
 
Mohamed Sanaulla
Saloon Keeper
Posts: 3159
33
Google App Engine Java Ruby
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is something called Coding to the interface.
With the first- We could assign instances of anything which implements List- ArrayList, LinkedList, Vector to the list reference
In the second case- We can assign instances of ArrayList only.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic