?
Solved

java function for pass values back

Posted on 2006-11-06
5
Medium Priority
?
239 Views
Last Modified: 2010-03-31
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
0
Comment
Question by:lilyyan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 9

Accepted Solution

by:
owenli27 earned 320 total points
ID: 17883734
They are passed by reference and you don't have to return them back to where you call fucntion. They are updated after void function end.
0
 

Author Comment

by:lilyyan
ID: 17883802
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?
0
 
LVL 9

Expert Comment

by:owenli27
ID: 17883863
correct
0
 
LVL 9

Expert Comment

by:owenli27
ID: 17883883
Java manipulate objects by reference, and all object variables are references.
0
 

Author Comment

by:lilyyan
ID: 17883991
clear : )
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses
Course of the Month10 days, 10 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question