aspose file tools*
The moose likes Beginning Java and the fly likes collections vs arrays? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "collections vs arrays?" Watch "collections vs arrays?" New topic
Author

collections vs arrays?

pras
Ranch Hand

Joined: Apr 04, 2007
Posts: 188
under what scenario we should use a array and in what scenarion we should use a collection?
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14114
    
  16

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.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
Don't get me started about those stupid light bulbs.
 
subject: collections vs arrays?