Composition in POO allows a class to act as a container that holds instances of other classes, fostering code reusability and enabling the creation of complex structures by combining simpler components. It establishes a "has-a" relationship, promoting encapsulation and flexibility, as the container class can access the public interface of the contained classes, but not their internal details, facilitating modular and adaptable code design.
upvoted 1 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
ghozlane
1 year, 1 month agoIBTIjL
1 year, 2 months ago