This week's book giveaway is in the Agile forum.
We're giving away four copies of The Software Craftsman and have Sandro Mancuso on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes passing int[ ] to a method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "passing int[ ] to a method" Watch "passing int[ ] to a method" New topic

passing int[ ] to a method

Ben Buchli
Ranch Hand

Joined: Mar 26, 2004
Posts: 83
Hi guys,
I am trying to pass an int array to a method but somehow it gets dumped somewhere between setArray() and calling the getArray() methods.
I checked all possible ways that came to my mind, but was not successful.
right after creating the array, the ints are in the array as they should be.
right after setArray() in my helper class, the array is as it should be.
but then, a little while later, when I call the arrayToString() method, all my 30 objects (all the same type, but different values) return the same array, not different ones, as they should...
is there something i miss with passing an array to a method??
any helps is greatly appreciated
Ben Buchli
Ranch Hand

Joined: Mar 26, 2004
Posts: 83
thanks for the help...
I guess I figured it out.
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
I'm glad we could serve as your Cardboard Analyst.

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: passing int[ ] to a method