This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

restricting methods access

 
Randy Smith
Ranch Hand
Posts: 44
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

how can I restrict method access to certain classes? some sample codes will be very useful
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33694
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Randy Smith
Ranch Hand
Posts: 44
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic