• 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
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Interfaces

 
Ranch Hand
Posts: 358
Firefox Browser Redhat Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
K&B say: "Interfaces can be implemented by any class from any inheritance tree."
Can an interface be declared inside a package? Interface can also have "default" access level, right?
If yes, the above sentence is a bit misleading. It should also include, "provided if the interfaces are visible". The authors no where discussed the access levels of interfaces and the inclusion of interfaces in packages.
Correct me if I am wrong.
 
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can an interface be declared inside a package?

How about java.io.Serializable for you?

It is clear (anyway, to me it is) that the interface being implemented must be accessible. If K&B went into every detail like this it vould be an extremly thick and chatty Java Language Specification. I would rather worry about the things it tells you that are wrong.
 
Faisal Ahmad
Ranch Hand
Posts: 358
Firefox Browser Redhat Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Barry!
"Can an interface be declared inside a package?" should have been "Interfaces can also be declared inside a package, right?"

Well, the book says it covers 100% details of exam. And it also says, to start with the book a minimum knowledge of Java is ok. I am not saying that the book is wrong or not worthful. I am saying, a few details are missing which would have been included in the book. Many ranchers have identified such missing info. To me thickness of the book is not a concern. Information it gives me is most important factor - be it a reference to some other book/web etc.
 
Whose rules are you playing by? This tiny ad doesn't respect those rules:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic