Need some help in hiding elements of my API from potential users...
807603Jan 1 2008 — edited Jan 1 2008Hi there folks from Java land.
How can I do the following/what keywords is needed to do:
Hiding a class in a library package, so that only classes in my package can access it- ie...
I have a bunch of classes in package foo.bar;
i want class foo.bar.Baz to be able to be called from classes that an end user writes.
class foo.bar.Baz uses class foo.bar.Bax to do some important things, and also uses foo.Bla class for other important things. I don't want the user messing around with the important classes in my *.jar distribution of my library, but if I declare these classes private , then Baz will only be able to access Bax and will be unable to see Bla as it is in a different package in my library...
This is puzzling me.
The next question is how can I write methods that can only be seen in my package and not other people who are using my package?
Regards
Jason.