aspose file tools*
The moose likes Beginning Java and the fly likes restricting methods access Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "restricting methods access" Watch "restricting methods access" New topic
Author

restricting methods access

Randy Smith
Ranch Hand

Joined: Mar 27, 2011
Posts: 44
Hi guys,

how can I restrict method access to certain classes? some sample codes will be very useful
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30957
    
158

You can use a modifier to only allow one class (private), classes in the same package (no modifier), subclasses + classes in the same package (protected) and all classes (public.)

There isn't a way to allow random methods access.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Randy Smith
Ranch Hand

Joined: Mar 27, 2011
Posts: 44
Jeanne Boyarsky wrote:You can use a modifier to only allow one class (private), classes in the same package (no modifier), subclasses + classes in the same package (protected) and all classes (public.)

There isn't a way to allow random methods access.


Thank you for the information
 
 
subject: restricting methods access