Re: return more than one object within one method



Roland,

> > This works fine, but now I would like to also receive an integer created
> > from the method e.bocreate().
>
> What's the return type of bocreate()?
> What does the integer represent? (maybe some count of matched items?)

By now, the bocreate() returns an ArrayList which is written to bO... sorry,
my code was really misunderstandable...

The integer I'd like to get from bocreate() too represents an account
number, so it has nothing to do with the ArrayList already returned...


> That's not possible, a method returns nothing (void), a primitive or an
> object (possibly null).
>
> However, you can define a new class that holds both, and bocreate()
> should return an instance of this class.
>
> There are other possibilities too, including the use of a collection
> class instance, or a 2 element Object array.
>

Well, after having read some information about the Collection, I think I
would use this way... which means that bocreate() has to put the ArrayList
and the integer in a new Collection object and return this to bORead(),
which will have to get the two out of the Collection, right?

I'll try tomorrow...

Many thanks so far and a very nice weekend!

Best regards


Frank


.