Machine-translated by Google. Questions are authored in English.
Top

Discussion

In object oriented programming, an abstraction that holds a collection of objects of some given class is called :

(i) Package list
(ii) Container or collection
(iii) Library
(iv) Directory list

  • A.(i) and (iii)
  • B.(ii) only
  • C.(i) and (iv)
  • D.(ii) and (iii)

Answer: B

The answer is (ii) only: a container or collection.

In object-oriented programming, a container (also called a collection) is an object whose job is to hold a group of other objects, such as a list, set, map or vector, and to provide operations to add, remove and iterate over them.

A package groups classes, a library is a set of reusable code, and a directory list is a file-system listing. None of these is the abstraction that holds objects of a class, so options naming them are wrong.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.