Re: return more than one object within one method
- From: "Frank Meyer" <f.meyer@xxxxxxxx>
- Date: Fri, 27 May 2005 22:13:16 +0200
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
.
- Follow-Ups:
- Re: return more than one object within one method
- From: Dale King
- Re: return more than one object within one method
- References:
- return more than one object within one method
- From: Frank Meyer
- Re: return more than one object within one method
- From: Roland
- return more than one object within one method
- Prev by Date: Re: check string for different criteria
- Next by Date: Re: return more than one object within one method
- 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):