File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "collections vs arrays?" Watch "collections vs arrays?" New topic

collections vs arrays?

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: 15092

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 8 API documentation
I agree. Here's the link:
subject: collections vs arrays?
It's not a secret anymore!