Link to home
Start Free TrialLog in
Avatar of lilyyan
lilyyan

asked on

java function for pass values back

Hello,

guess i stocked by a simple question.

Suppose in a java class:
public class testName{

LinkedList list1, list2, list3

 list1 = value1;
 list2 =value2;
 list3 = value3;

private void searchList (list1, list2, list3 ){
LinkedList list1temp = list1,
                 list2temp = list2,
                 list3temp = list3;

// do some process for the three lists, then their there values will be changed

}

my question is: how can i pass the changed values back for list1, list2, list3, if i use return statement , only one value can be returned at one time.

Thanks very much for your reply,

lilyyan
ASKER CERTIFIED SOLUTION
Avatar of Weiping Du
Weiping Du
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lilyyan
lilyyan

ASKER

hi, that's what i'm thinking.

when you say "passed by reference " , this can only be applyed to certain data types, not for primary data type, for example: int, right?
correct
Java manipulate objects by reference, and all object variables are references.
Avatar of lilyyan

ASKER

clear : )