Re: return more than one object within one method




"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


.