Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

collections vs arrays?

 
pras
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
under what scenario we should use a array and in what scenarion we should use a collection?
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15362
39
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An example: Arrays are not resizeable at runtime. So if you need a collection of objects that doesn't have a fixed size, you'll need to use a collection class.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic