[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

java function for pass values back

Posted on 2006-11-06
5
Medium Priority
?
241 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

650 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