A book has one or more pages. Which of the following concepts characterize it best ?

  1. Inheritance

  2. Composition

  3. Association

  4. Specialization


Correct Option: B
Explanation:

To solve this question, the user needs to have a basic understanding of object-oriented programming concepts.

The book and page relationship can be best characterized as a composition relationship. Composition is a "has-a" relationship between two or more classes, where one class is a part of another class. In this case, a book has one or more pages, and each page is a part of the book. Therefore, the best option is:

The Answer is: B (Composition)

Find more quizzes: