Re: return more than one object within one method
- From: "Allan Bruce" <amb@xxxxxxx>
- Date: Fri, 27 May 2005 21:30:36 +0100
"Frank Meyer" <f.meyer@xxxxxxxx> wrote in message
news:d77cp2$hs6$1@xxxxxxxxxxxx
> Hi newsgroup,
>
> I have a little problem with a method that tries to use another method in
> another class.
>
> So far this method receives an ArrayList as follows:
>
> private ArrayList bORead()
> {
> Einl e = new Einl();
> bO = e.bocreate();
> }
>
>
> This works fine, but now I would like to also receive an integer created
> from the method e.bocreate().
> I know that the method bocreate() can only return one object, nevertheless
> I
> found some information about collections that could wrap more than one
> object.
>
> Does anyone know if it is possible to receive more than one object (with
> different object types) from one method?
>
> Any help is greatly appreciated.
>
> Thanks very much in advance and best regards!
>
>
> Frank
>
>
You can do this if you return a Collection of Objects. For example you
could have a Vector. You would need some wrapper class though to tell you
what type of data each entry holds but other than that - its trivial.
Allan
.
- Follow-Ups:
- Re: return more than one object within one method
- From: Frank Meyer
- Re: return more than one object within one method
- References:
- return more than one object within one method
- From: Frank Meyer
- return more than one object within one method
- Prev by Date: Re: return more than one object within one method
- Next by Date: applet paint() refresh problems
- Previous by thread: Re: return more than one object within one method
- Next by thread: Re: return more than one object within one method
- Index(es):