Which of the following concepts provided facility of using object of one class inside another class?
Answers
Answered by
2
Answer:
Inheritance
Explanation:
Using inheritance , we can use the public as well as protected members of one class inside another class
Answered by
0
Composition
the following concepts provided facility of using object of one class inside another class is Composition.
- Composition is the idea of incorporating items from one class into another.
- One of the core ideas of object-oriented programming is composition. It specifies a class that uses instance variables to refer to one or more objects from other classes. This enables you to simulate an object-object association.
- Object composition describes the idea or logical organization of the data, not its actual implementation or physical data structure.
- For instance, a sequence and a set are different from one another in that a sequence's compositional order is important while a set's is not.
- It is referred to as composition when one item contains another and the enclosed object cannot exist without the other. A composition, to put it more precisely, is a method of referencing two or more classes using instance variables, and an instance must be built before it is used.
#SPJ3
Similar questions