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.
No, tomorrow we rule the world! With this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop