Ask Question
29 January, 05:10

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.

+1
Answers (1)
  1. 29 January, 07:40
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers