Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Please help with is-a masterexam question

 
Paolo Dina
Ranch Hand
Posts: 63
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ankit Garg
Sheriff
Posts: 9497
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Paolo Dina
Ranch Hand
Posts: 63
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 686
Chrome Netbeans IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are mistakes in the MasterExam LearnKey ... beware
 
Paolo Dina
Ranch Hand
Posts: 63
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 686
Chrome Netbeans IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic