215k views
5 votes
True or False: The major advantage of Arrays over ArrayLists in Java is the fact that while ArrayLists are fixed in size, an Array can increase or decrease in size as needed.

User Suzy
by
4.7k points

1 Answer

2 votes

Answer:

False

Step-by-step explanation:

It's the other way round actually. Arraylists do not have fixed size and can increase or decrease in size as needed. On the other hand, Arrays are fixed from when they are declared; they have a particular size that number of elements cannot go beyond.

An arraylist in Java is a class that is part of a Java collection framework(java.util) that can have variable sizes and only store objects, not primitive data like strings or integers. An array is a data structure in Java and can store both primitive data and objects, while having a fixed size at declaration.

User Ashan Marla
by
4.9k points