Vidyalelo
Java Programming · Q169

Java Collections Framework

Programming · Java Programming · question 169

Q169

What is the difference between length() and size() of ArrayList?

A.
length() and size() return the same value
B.
length() is not defined in ArrayList
C.
size() is not defined in ArrayList
D.
length() returns the capacity of ArrayList and size() returns the actual number of elements stored in the list
Answer

Answer: Option D

Solution

Answer: Option D
No explanation is given for this question Let's Discuss on Board