• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

sample question on Sun website

 
Barkat Mardhani
Ranch Hand
Posts: 787
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Given:
10. class A {}
11. class B {
12. private A myA = new A();
13. }
Which two statements are true about the relationship between class A and class B? (Choose two.)

A
A maintains no relationship with B
B
B maintains no relationship with A
C
B maintains a "one to many" relationship with A
D
The relationship can be described with a has-a clause
E
The relationship can be described with an is-a clause

The answer is A and D. I agree with D. But how is A true? A relationship takes two entities. If B has a "has" relationship with A, then A also has a "part of" relationship with B.
 
sopal Pal
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Object A has no info about the Object B.
That is why it is said that Object A has no relationship to B.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic