This week's book giveaway is in the Artificial Intelligence forum.
We're giving away four copies of Pragmatic AI and have Noah Gift on-line!
See this thread for details.
Win a copy of Pragmatic AI this week in the Artificial Intelligence 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 ...
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Joe Ess

confusion in k&b page 118  RSS feed

Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey rancher i have a confusion in the following paragraph that i have took from k&b of page 118 as

" You can extends only one class , but implements many interface. But remember that subclassing define who and what you are , whereas implementing define a role you can play or a hat you can wear, despite how diffrent you might be from some other class implementing the same interface"

in the above paragraph i confused from "But remember that to onwards....

please specify

with regard

Arun kumar maalik
Ranch Hand
Posts: 2023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A class that implements the interface agrees to implement all the methods defined in the interface, thereby agreeing to certain behavior. So, we can have different implementation of the same method (that is in interface) in different classes. The coding behavior with interfaces provides a cleaner separation of behavior and implementation.
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!