Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
The moose likes Beginning Java and the fly likes using method in an array 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 "using method in an array" Watch "using method in an array" New topic

using method in an array

Chris Davies
Ranch Hand

Joined: Feb 26, 2003
Posts: 110

is it possible to get the values for an array from the values returned by a method ? or is ther a simpler way of doing it ?

for example

String WordList

String LL = WordList.getLegalList

String [] words = {LL};



One day all greenhorns will run free ...
Darin Niard
Ranch Hand

Joined: Jun 08, 2004
Posts: 118
I'm not really sure I understand your question but... I suppose it really depends on what this method is returning.
Jeffrey Hunter
Ranch Hand

Joined: Apr 16, 2004
Posts: 305
Build your array in the method, then return the array.

mk aftab

Joined: Jun 08, 2003
Posts: 1
you can make a function with some parameters, make your array and return it.
Jonathan Hall

Joined: Jun 30, 2004
Posts: 2
Hey Chris,

Maybe your question can be answered a little more thoroughly at:

Just go to the search page and enter "array" in the text box and hit enter.
I agree. Here's the link:
subject: using method in an array