This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes method returning an array? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "method returning an array?" Watch "method returning an array?" New topic
Author

method returning an array?

M Shaw
Greenhorn

Joined: Sep 14, 2008
Posts: 11
Hey,
If I have a method that returns an array, say makeArray(), then in another method can I make a new array and set it to the method?
for example something like this:
int[] array2 = makeArray();
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37897
    
  22
Yes.

Assuming makeArray returns an int[].
M Shaw
Greenhorn

Joined: Sep 14, 2008
Posts: 11
yey! Thank you
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37897
    
  22
You're welcome
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: method returning an array?
 
Similar Threads
Arrays...
Help with Arrays!
Genrics Array creation
Array out of bounds exception .split()
application hang up