return code of multiple java process

Hi,

I have a unix shell script which is launching multiple java processes by calling a java class in a loop, but each time with a different set of parameters.

Now I have to use the return code from each process in the script later.
but how do i obtain the return code from each process since the $? only retrieves the return code from the last completed process

any suggestions?

Could you please post a sample of your existing code. Plus, $! gets the pid of the most recent bg process.