Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes B&S: Class modifier for Data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "B&S: Class modifier for Data" Watch "B&S: Class modifier for Data" New topic

B&S: Class modifier for Data

Bodenstab Oliver
Ranch Hand

Joined: Mar 03, 2005
Posts: 47

can i use friendly/Package-Access as the access modifier for the class Data or must i use public?

I want, that the user can only access the buisiness layer and not the data layer of my application. The buisiness layer has a public class with public methods.

Thanks for response


Frans Janssen
Ranch Hand

Joined: Dec 29, 2004
Posts: 357
Hi Oliver,

Yes, you can use package access. There is no explicit must that you can't, so it is allowed.


It is sorta covered in the JavaRanch Style Guide.
subject: B&S: Class modifier for Data
It's not a secret anymore!