Link to home
Start Free TrialLog in
Avatar of edmund_mitchell
edmund_mitchell

asked on

newbie visibility question

Hello all
I have a class Fred.  A Fred object has a property a and a public boolean method b().
I also have a class Barney, which is very important to a lot of other classes.  Barney's main data object is an array of Fred objects:
public Fred[][] fredArray = new Fred[8][8];
Lots of other classes need to access this array of Fred objects.
One of them, class Wilma, wants to say something like:
boolean wilmaBool = fredArray[x][y].b()
What verbiage needs to be at the top of which classes to make this happen?
I mean, I probably need stuff like import or maybe package at the top of some/all of these classes, but I'm a bit lost as to what goes where.

Thanks for your help,

Edmund
Avatar of girionis
girionis
Flag of Greece image

 You do not have to import anything. Just put all the classes in the same package and then you can access them by simply declaring them - without importing them.

  Hope it helps.
ASKER CERTIFIED SOLUTION
Avatar of expertmb
expertmb

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
expertmb is right
What sort of a proposed answer is that???
Avatar of expertmb
expertmb

what is this vogen?
you can post comment and dont propose somebody's comment as proposed answer.

mb...
Avatar of edmund_mitchell

ASKER

A vote of confidence in someone else's response is not an answer.
Thanks
Edmund