wood burning stoves 2.0*
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 Murach's Java Servlets and JSP this week in the Servlets 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.

With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: sample question on Sun website
Similar Threads
HAs-a Relationship Problem SCJPTEST
relationship between classes
has-a. equals (maintains No Relationship)
question about "has a" at SUN's mock exam
question from sun