Last active
June 27, 2016 11:35
-
-
Save xeviknal/4cc2ca367eb503b92f2c182f024ace28 to your computer and use it in GitHub Desktop.
Java allows multiple params definition on a method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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