This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Building Blockchain Apps and have Michael Yuan on-line!
See this thread for details.
Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization 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 ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

Avoiding multiple inheritance problems with default methods

 
Ranch Hand
Posts: 86
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On pages 277-278 in the book 'Certified Associate Java SE 8 Programmer I' by Jeanne Boyarsky and Scott Selikoff, it talks about how to default methods interact with multiple inheritance. Here is a similar example of code for those pages:





My question is what made the book think that line 15 in Shark2 would work?

I get the error, "Shark2.getNumberOfFins cannot be resolved to a type".
 
Ranch Foreman
Posts: 82
1
VI Editor Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're missing brackets after Shark2...

 
Master Rancher
Posts: 112
20
Firefox Browser MySQL Database Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm afraid I don't have access to the book; what does it say about this example? The two commented lines at the bottom do work.
 
Marshal
Posts: 68112
258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Discussion added to our certification forum.

Have a look at this thre‍ad, which may tell you more about your question
 
What could go wrong in a swell place like "The Evil Eye"? Or with this tiny ad?
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!