GeeCON Prague 2014*
The moose likes Beginning Java and the fly likes return 2 strings Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "return 2 strings" Watch "return 2 strings" New topic
Author

return 2 strings

Anthony Smith
Ranch Hand

Joined: Sep 10, 2001
Posts: 285
I got a function, and I want to return 2 string? What should I do?
Anthony Villanueva
Ranch Hand

Joined: Mar 22, 2002
Posts: 1055
You could return a:
1. String []
2. List containing your Strings
3. a user-defined class that aggregates 2 Strings
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Or a single string that is the concatenation of the two desired return values seperated by some character or character sequence.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
GeeCON Prague 2014
 
subject: return 2 strings