LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 09-19-2006, 06:05 AM   #1
kornerr
Member
 
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893

Rep: Reputation: 35
How to pass array to a function in Java so that it returns changed?


I need smth like func (array *a), but in Java.
Yes, I know: Java manipulates objects 'by reference,' but it passes object references to methods 'by value.'
But how to accomplish what I need?
Thanks.
 
Old 09-19-2006, 12:16 PM   #2
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
have you actually tried to pass an array to a function? there is nothing special to accomplish what you need. if pass an array, then change the array in the function, the passed array will be changed back in the callers scope.

or am i missing something here?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
trunc function returns a double? :confused: zahadumy Programming 6 12-03-2005 10:20 PM
C function that returns $HOME cbranje Programming 1 02-12-2005 05:41 PM
open function returns error sudheernair Programming 2 05-07-2004 11:14 AM
A main can be changed by a function local without passing anything to the function? ananthbv Programming 10 05-04-2004 01:31 PM
Cannot pass and return a character array Linh Programming 1 06-12-2003 04:17 PM


All times are GMT -5. The time now is 04:26 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration