QuestionQ59Verified/Advanced Object-Oriented ProgrammingCopy linkReport a problemAsk AstroTutorSave questionSelect the true statement about composition.AComposition extends a class’s capabilities by adding new components and modifying the existing onesBComposition allows a class to be projected as a container of different classesCComposition is a concept that promotes code reusability, while Inheritance promotes encapsulationDComposition is based on the has a relation, so it cannot be used together with inheritanceShow AnswerAnswerExplanationComposition represents a has-a relationship in which a class contains objects from other classes, allowing it to serve as a container for instances of different classes. It can also be combined with inheritance.Show comments0Show commentsCommunity DiscussionNo comments yet. Be the first to start the discussion!
Community Discussion