QUESTION IMAGE
Question
assignment: post-course assessment
questions fa9pl10h.post.42m
40.
41.
- a has - a relationship occurs between ______.
a. a class and an object instantiated from it
b. a derived class and a base class
c. two methods with the same name but different parameters
d. a class and an object of another class that it contains
43.
44.
45.
46.
Brief Explanations
To determine the correct option for "A has - a relationship occurs between...", we analyze each option:
- Option a: A class and an object instantiated from it represents an "is - an" relationship (instantiation), not "has - a".
- Option b: A derived class and a base class represents an "is - a" relationship (inheritance), not "has - a".
- Option c: Two methods with the same name but different parameters is method overloading, not related to "has - a" relationship.
- Option d: A class and an object of another class that it contains is the definition of a "has - a" relationship (composition/aggregation), where one class contains an object of another class.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
d. a class and an object of another class that it contains