Javatpoint Logo
Javatpoint Logo

Difference between length of array and size() of ArrayList in Java

ArrayList doesn't have length() method, the size() method of ArrayList provides the number of objects available in the collection.

Array has length property which provides the length or capacity of the Array. It is the total space allocated during the intialization of the array.

Output:

10
2




Youtube For Videos Join Our Youtube Channel: Join Now

Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA