Given:
Which three statements concerning the OO concepts “is-a” and “has-a” are true?
A.
Flimmer is-a Plinkable
B.
Flommer has-a Tagget
C.
Flommer is-a Glommer
D.
Tagget has-a String
E.
Flommer is-a Plinkable
F.
Flimmer is-a Flommer
G.
Tagget is-a Plinkable
Explanation:
A: Flimmer implements Plinkable.
Flimmer is-a plinkable.
D:The relationship modeled by composition is often referred to as the “has-a” relationship. HereTaggethas-aString.
F: Flommer extends Flimmer
So there is an “is-a relationship between Flommer and Flimmer .Note: Thehas-a relationship has anencapsulation feature (like private or protected modifier used before each member field or method).
My answer is A,B,E.
Who is agree/disagree?
Yes,Kamil , I agree with you
Should be A,D, E.
F is incorrect.
ADE
A: Flimmer implements Plinkable -> Flimmer is-a plinkable
D:The relationship modeled by composition is often referred to as the “has-a” relationship. -> HereTagget has-a String.
E: Flommer extends Flimmer and Flimmer implements Plinkable -> Flommer is-a Plinkable
But String s is not a member, just a local variable. I would choose A, B, E
ABE
ABDE
ABE
ABE
A, B, E
ABE
ABE
ABE
ABE
Why Flommer has-a Tagget?
ABE
B. Flommer has-a Tagget:
OCA/OCP Java SE 7 Programmer I & II Study Guide (Kathy Sierra, Bert Bates)
93 Inheritance and Polymorphism (OCA Objectives 7.1, 7.2, and 7.3)
Class A HAS-A B if code in class A has a REFERENCE to an instance of class B.
A. True : Flimmer implements Plinkable -> Flimmer is-a plinkable
E. True : Flommer extends Flimmer and Flimmer implements Plinkable -> Flommer is-a Plinkable
How if the list is an empty list?
ADE
abe