Examveda

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: Option D


This Question Belongs to Java Program >> Collections Framework In Java

Join The Discussion

Comments (1)

  1. Ganesh Commn
    Ganesh Commn:
    2 months ago

    The correct answer is B. length() is not defined in ArrayList

Related Questions on Collections Framework in java