#optional parameters
5 messages · Page 1 of 1 (latest)
Hey, @onyx gull!
Please remember to /close this post once your question has been answered!
And I don't want to do:
public String returnStrings(String text1, String text2)
{
return text1+text2;
}
public String returnStrings(String text1)
{
return text1;
}
Oh yes I can, this is the way:
public static String returnStrings(String... texts)
{
String result = "";
for (String text : texts)
{
result += text;
}
return result;
}