aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes IS-A HAS-A Relationship Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "IS-A HAS-A Relationship" Watch "IS-A HAS-A Relationship" New topic
Author

IS-A HAS-A Relationship

Sidharth Khattri
Ranch Hand

Joined: Sep 16, 2013
Posts: 121

Question is from scjptest
What is true about has-a and is-a relationships? (Choose two)
A) Instance variables can be used when creating a has-a relationship.
B) Inheritance represents an is-a relationship.
C) Inheritance represents a has-a relationship.
D) Instances must be used when creating a has-a relationship.
Answers: A, B
The is-a relationship is expressed with inheritance and has-a relationship is expressed with composition.


I selected B and D, and D is wrong. Why?
What else other than an instance can be used for HAS-A relationship?


OCPJP 6 - 96%
Sidharth Khattri
Ranch Hand

Joined: Sep 16, 2013
Posts: 121

Found the answer:
http://www.coderanch.com/t/487816/java-programmer-SCJP/certification/OO-Fundamentals
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: IS-A HAS-A Relationship