[Bluej-discuss] How to call an accessor mehtod in a different class?
Tony Pattison
tony_pattison at yahoo.co.uk
Sun Nov 18 10:45:54 GMT 2007
Aryeh, thanks for the hint. There is no way that I would have guessed or
stumbled on that particular syntax.
As to students not posting here. Sorry. But I'm teaching myself from
this book (that was exercise 4.26 of OFWJ) at home, so I have no
instructor to ask. That said, if you could point me at a more
appropriate forum/mailing list, I'd be grateful.
thanks again
Tony
On Sat, 2007-11-17 at 15:36 -0500, Aryeh Friedman wrote:
> First of all this list is not for student questions.... second you
> need to wrap the accessor for a inner object with an accessor in the
> outer object
>
> On Nov 17, 2007 3:17 PM, Tony Pattison <tony_pattison at yahoo.co.uk> wrote:
> > If ObjectA has an arraylist of ObjectB, and each ObjectB contains an
> > instance of ObjectC which in turn contains an instance of ObjectD, and
> > the class that defined ObjectD has an accessor method getName() . How do
> > I call that method from within the class that defined ObjectA ?
> >
> > Calling methods from the class that defined ObjectB is easy, for
> > instance I enter 'lot.toString()' , but I have yet to find (or stumble
> > upon) a way of coding the getName() method in this fashion.
> >
> > Any help would be much appreciated.
> >
> > Tony
> >
> >
> > _______________________________________________
> > mailing list bluej-discuss at bluej.org
> > To unsubscribe or change your preferences, go to
> > http://lists.bluej.org/mailman/listinfo/bluej-discuss
> >
> _______________________________________________
> mailing list bluej-discuss at bluej.org
> To unsubscribe or change your preferences, go to
> http://lists.bluej.org/mailman/listinfo/bluej-discuss
More information about the bluej-discuss
mailing list