-
What is the difference between length() and size() of ArrayList?
-
- size() is not defined in ArrayList
- ength() and size() return the same value
- length() returns the capacity of ArrayList and size() returns the actual number of elements stored in the list
- length() is not defined in ArrayList
- None of these
Correct Option: C
length() returns the capacity of ArrayList and size() returns the actual number of elements stored in the list which is always less than or equal to capacity.