Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Slight error in Malea Gupta oca 8 certification book

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Mala Gupta's OCA 8 book (Chapter 6, section 6.2.8, figure 6.16), there is a slight error. Following is the code from the figure 6.16.

Now the book says that if we change the abstract method maxDistance to static method in Jumpable interface then the class Forest won't compile and give error on the following line:

But, it would compile fine because, the Animal class still has the method named maxDistance and that method will be called by 'lion.maxDistance()'. If we remove the maxDistance method definition from Animal class then only the compiler will give the error and that too because the compiler would not find the method named maxDistance() in the Animal class.

Thank you.
No, tomorrow we rule the world! With this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic