Difference between array and arraylist | Sololearn: Learn to code for FREE!


Difference between array and arraylist

Why do I need to use array until an array-list?

5/13/2018 4:02:57 AM

Alejandro Rollano

7 Answers

New Answer


Array: Simple fixed sized arrays that we create in Java. ArrayList : Dynamic sized arrays in Java that implement List interface. Array is a fixed size data structure while ArrayList is not. One need not to mention the size of Arraylist while creating its object. Even if we specify some initial capacity, we can add more elements. Array can contain both primitive data types as well as objects of a class depending on the definition of the array. However, ArrayList only supports object entries, not the primitive data types (when we Add a primitive type to an ArrayList it is internally boxed to Object type).


array is static in the execution and arralist you can have n elements is dynamic


Thank you very much guys to taking the time to answer ^^


the fact is array :-> is a collection of same type of data. whereas arraylist :->is a collection of arrays..


In array we only written similar datatype variables but incase of list we write different datatype variables ..


it is type of data type😊👌👍


in arraylist you can direct access with the values like arraylist a=new arraylist() a.add(5); a.add(7); etc.