composition and inheritance

mcqspedia.com has 5 Question/Answers about Topic composition and inheritance

Classes refers to use of one or more classes within definition of another class, is called

Classes refers to use of one or more classes within definition of another class, is called
  • A. Inheritance
  • B. Composition
  • C. Provision
  • D. None of them
  • Correct Answer: Option B

We can define a new class from an existing class, by using

We can define a new class from an existing class, by using
  • A. Inheritance
  • B. Composition
  • C. Constructors
  • D. Both A and B
  • Correct Answer: Option D

When a data member of new class is an object of another class, it is called as

When a data member of new class is an object of another class, it is called as
  • A. New class is a composite of other objects
  • B. New class is inherited
  • C. New class is aggregate of another
  • D. None of them
  • Correct Answer: Option A

Composition is also called as

Composition is also called as
  • A. Containment
  • B. Provision
  • C. Aggregation
  • D. Both A and C
  • Correct Answer: Option D

There are how many ways to use existing classes to define a new class?

There are how many ways to use existing classes to define a new class?
  • A. 1
  • B. 2
  • C. 3
  • D. 4
  • Correct Answer: Option B