• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Please help with is-a masterexam question

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 686
Netbeans IDE Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are mistakes in the MasterExam LearnKey ... beware
 
Paolo Dina
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Netbeans IDE Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
I claim this furniture in the name of The Ottoman Empire! You can keep this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic