An UML diagram has a rectangle representing class A is connected by a solid line and a solid (dark) diamond near class A from class B. In Java implementation a.Class B will have a reference to Class A b.Class A will have a reference to Class B c.Class B has an aggregation relationship with Class A d.Class A has an composition relationship with Class B They say answer a is the correct one, but I think that also d is correct. What do you think?
Originally posted by Eduardo Cobian: My mistake. They say that answer b is correct. What about answer d?
I have also taken this test. You have the same confusion which I had. The question is trying to differentiate between "Java Implementation ie code" and conceptual relationship. Conceptually class A has composition relationship with B but when you code the class A it will have a reference to an instance of class B. In fact, there is a repeat question on that test without the word "implementation" and the correct answer given is D. Hope that helps :-)