Welcome to Westonci.ca, where curiosity meets expertise. Ask any question and receive fast, accurate answers from our knowledgeable community. Our Q&A platform provides quick and trustworthy answers to your questions from experienced professionals in different areas of expertise. Connect with a community of professionals ready to provide precise solutions to your questions quickly and accurately.

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.