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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
correct
Java manipulate objects by reference, and all object variables are references.
ASKER
clear : )
ASKER
when you say "passed by reference " , this can only be applyed to certain data types, not for primary data type, for example: int, right?