File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes sample question on Sun website Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "sample question on Sun website" Watch "sample question on Sun website" New topic

sample question on Sun website

Barkat Mardhani
Ranch Hand

Joined: Aug 05, 2002
Posts: 787
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 maintains no relationship with B
B maintains no relationship with A
B maintains a "one to many" relationship with A
The relationship can be described with a has-a clause
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

Joined: Aug 04, 2003
Posts: 83
Object A has no info about the Object B.
That is why it is said that Object A has no relationship to B.

Don't get me started about those stupid light bulbs.
subject: sample question on Sun website