Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

returning an array...  RSS feed

 
Brandi Love
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you return an array from a member method to the main method? If so, how would one go about doing it?
[ December 03, 2003: Message edited by: Brandi Love ]
 
Karthikeyan Rajendraprasad
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
say you are having an method that returns a String array it should be like
private String[] returnArray()
{
String strArray[];
......
return strArray;
}
 
Brandi Love
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ahh I see. I was trying to do this for a program and I was declaring the method like this: public static passArray. I just wasn't putting the brackets it. Thank you very much!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!