81.2k views
0 votes
Which of the following statements are true?

I. ArrayLists cannot be used in situations where the number of elements never changes.
II. ArrayLists are useful in situations where the number of elements stored is likely to change over time.
III. The size of an ArrayList can never exceed its initial capacity.

a. I only
b. II only
c. III only
d. II and III only
e. I, II, and III

User Tywanna
by
6.6k points

1 Answer

2 votes

Answer:

Option B i.e., II only is the correct option

Step-by-step explanation:

Array is the derived data type that contains one type of elements at a time, for example, if they contain integer type then they not contain the string type data. The ArrayList contains numbers as well as characters or string that can be changed when the programmer wanted to change it by the indexing.

So, that's why the following option is true.

  • Option A is not correct because we can change the elements of an ArrayList whenever we want.
  • Option C is not correct because the size of the array can be exceed.
User August Miller
by
5.8k points