Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP 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
Pie
Posts: 15441
41
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