peter cooke wrote:The problem is the method need to allow access only to it from a call from the class Foo or Bar. Preferably hide it all together from other classes.
Any thoughts???
Yes: why do you need to do this? It sounds very arcane.
However, if the reason for calling the method is to get a result of some kind, one possibility would be to add a proxy class in Bar's package that can call this method on behalf of a Foo, and
update the Foo with its result. Alternatively, you could prevent any other class from calling it by supplying an object that can ONLY be created by a Foo. Either way, if you set it up right, no other class would ever be able to see the result.
But it's incredibly tortuous, so my advice would be to back up and work out WHY you want to do this. Don't leap to the HOW until you understand that.
Winston