Q - You’re designing a new online board game in which Floozels are a type of Jammers, Jammers can
have Quizels, Quizels are a type of Klakker, and Floozels can have several Floozets. Which of the
following fragments represent this design?
Pritish Chakraborty wrote:I'm sorry, I didn't get you....
Of course those two points are very clear but here Floozel and Floozet are two interfaces linked through inheritance, not through composition.
How does the HAS-A relationship come into question at all?
Doesn't this sentence say that?
I would infer the following:
Quizels extends Klakker (are a type of Klakker) and when Floozels can have several Floozets, would mean Floozels has one to many Floozets as its member. How could I apply IS-A relationship here? Do you understand it now?
By the way, Answer option 4 is wrong. Any wrong answer in the SCJP exam is just to confuse you. The interface in the option 4 above is also to confuse you.