Re: return more than one object within one method



Frank Meyer wrote:
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...

Then it sounds like returning it should not be part of this method. Each method should only do one thing. A little test I use is to see if you can come up with a simple name for the multiple things you are trying to return without using the word "and". If not that's a red flag saying that you probably are trying to do something wrong.


It sounds like you have a design problem and we can't really help you with that without understanding what it is you are trying to do in the actual program.

--
 Dale King
.