aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Please help with is-a masterexam question 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 "Please help with is-a masterexam question" Watch "Please help with is-a masterexam question" New topic
Author

Please help with is-a masterexam question

Paolo Dina
Ranch Hand

Joined: Aug 15, 2008
Posts: 63
Source MasterExam CD included with K&B book. Which statement(s) are true? (Choose all that apply.)

A: is-a relationships always rely on inheritance.
B: is-a relationships always rely on instance variables.
C: is-a relationships always require at least two class types.
D: is-a relationships always rely on polymorphism.
E: is-a relationships are always tightly coupled.

Why the correct answers accordingly to masterexam are A C and D? I'd rather say that all the options are false. Comments?

A: false because they rely on inheritance OR (interface) implementation.
B: false because inheritance is independent of the existence of instance variables. (original explanation)
C: false because they require at least two types, not necessarily class types (interface A {} class B implements A { } // an instance of B is-a A)
D: not sure but I'd say false. Isn't polymorphism a "feature" that rely on inheritance? (No inheritance -> no polymorphism)
E: false because coupling is not used to evaluate classes within the same inheritance tree. (original explanation)

Thanks


SCJP 5
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9313
    
  17

Paolo Dina wrote:A: false because they rely on inheritance OR (interface) implementation.


Isn't interface implementation also a kind of inheritance??

C and D are probably given as correct because of an error in the Master Exam...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Paolo Dina
Ranch Hand

Joined: Aug 15, 2008
Posts: 63
I was confused because the book says that is-a concept is based on class inheritance or interface implementation, but effectively I had not realized (not a nice thing..) that implementation implies inheritance. Thanks for having pointed it out.
Vyas Sanzgiri
Ranch Hand

Joined: Jun 16, 2007
Posts: 686

There are mistakes in the MasterExam LearnKey ... beware


===Vyas Sanzgiri===
My Blog
Paolo Dina
Ranch Hand

Joined: Aug 15, 2008
Posts: 63
Thank you for the warning, I have spotted some of them. It would be useful if there were an errata. Maybe it already exist somewhere (where?), but otherwise we could collect them and make one.
Vyas Sanzgiri
Ranch Hand

Joined: Jun 16, 2007
Posts: 686

There is Errata for the K&B book but there is no errata for the LearnKey exams primarily because the questions are taken from a pool and do not come in sequence. But I would alert you on all fronts - in all exams (even commercial) I found a lot of mistakes. So double-triple check or type the question in an IDE to confirm your answers. For theoretical questions - JavaRanch rocks
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Please help with is-a masterexam question