Skip to content

Instantly share code, notes, and snippets.

@xeviknal
Last active June 27, 2016 11:35
Show Gist options
  • Save xeviknal/4cc2ca367eb503b92f2c182f024ace28 to your computer and use it in GitHub Desktop.
Save xeviknal/4cc2ca367eb503b92f2c182f024ace28 to your computer and use it in GitHub Desktop.
Java allows multiple params definition on a method
public MultipleArgumentsExample {
public void say(String... words) {
for(int i = 0; i < words.length; i++)
System.out.println(words[i]);
}
public void say(String cheers, String... words) {
System.out.println(cheers);
say(words);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment