What is the difference between the size of ArrayList and length of Array in Java?

Java 8Object Oriented ProgrammingProgramming

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 initialization of the array.

raja
Published on 17-Jan-2018 09:55:14
Advertisements