Discover the answers you need at Westonci.ca, where experts provide clear and concise information on various topics. Experience the ease of finding quick and accurate answers to your questions from professionals on our platform. Get immediate and reliable solutions to your questions from a community of experienced professionals on our platform.

Which of these method of ArrayList class is used to obtain present size of an object/

a. size()
b. length()
c. index()
d. capacity()


Sagot :

Answer:

The method of ArrayList class which is used to obtain the present size of an object is:

a. size()

Explanation:

In ArrayList, the size() method provides the number of objects available in the collection, array, or list.  In Java programming, ArrayList forms a part of the collection framework and has a set of methods to access elements and modify them.  An ArrayList does not have a fixed-size data structure, unlike an Array, but continues to expand in size.