Ask Question
30 April, 03:32

Anew class is proposed to collect information about a group of dvds. a separate class containing information about a single dvd, named dvd, has already been created. which of the following is the best design to store the data and size of this collection?

a) have an arraylist of dvds and use its size as the size of the collection.

b) have an arraylist of dvds and an integer representing the number of dvds in the collection.

c) have an array of dvds and use its size as the size of the collection.

d) have a single dvd variable representing the last dvd added and an integer representing the number of dvds in the collection.

+3
Answers (1)
  1. 30 April, 05:23
    0
    The answer is "Option a".

    Explanation:

    The ArrayList is often similar to an array but in this, we can re-sized the collection of the elements, that's why it also is known as a dynamic array. As compare to the array, in the array list we increase and decrease the length to fit the new components. It also uses an array to hold the elements. Just like arrays, the index enables users to access their items, and wrong choices can be described as follows:

    In option b, It is wrong because it stores all types of data. In option c, It uses the size to described its range that's why it is wrong. In option d, It is wrong because It uses index value to represent ArrayList.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Anew class is proposed to collect information about a group of dvds. a separate class containing information about a single dvd, named dvd, ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers