• Post Reply Bookmark Topic Watch Topic
  • New Topic

arraylist  RSS feed

 
sihani rani
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi


What is the difference between List obj=new ArrayList() and ArryList obj=new ArrayList();


 
Campbell Ritchie
Marshal
Posts: 55772
163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the first case you can replace obj with a LinkedList or some other implementation of the List interface. That is usually regarded as better practice. By saying "List" you are promising the compiler that every method of the List interface will be available.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!