my dog learned polymorphism*
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
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "passing int[ ] to a method" Watch "passing int[ ] to a method" New topic
Author

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
Ben Buchli
Ranch Hand

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

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]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: passing int[ ] to a method