wood burning stoves 2.0*
The moose likes Java in General and the fly likes Protected Access Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Protected Access" Watch "Protected Access" New topic

Protected Access


Joined: Jul 06, 2000
Posts: 16
I thought I remembered reading that protected fields/methods were accessible to only one level of subclasses. When I recently tested that, I found that it was not true. Does anyone else remember reading that in some book and if so which book?
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
protected varibles/methods can be accessible from the same class,sub classes in the same package, other classes in the same package and sub classes in other packages.
i dont know from which book i found it but i read it in some book.
Consider Paul's rocket mass heater.
subject: Protected Access
Similar Threads
Declaration and Access Control
Passed SCJP with 93%
combination of access & non-access modifiers for a class
Can you synchronize an array?
Do you read books on computer