Created
May 7, 2013 13:30
-
-
Save rmswimkktt/5532567 to your computer and use it in GitHub Desktop.
メソッドに複数の引数を渡す方法で、知らない書き方(multiArgument1)があった…。
This file contains hidden or 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 class MultiArgument { | |
public static void main(String[] args) { | |
MultiArgument.multiArgument1("Apple", "Orage", "Grape"); | |
String[] strings = {"Apple", "Orage", "Grape"}; | |
MultiArgument.multiArgument2(strings); | |
} | |
public static void multiArgument1(String... strings){ | |
for(String string : strings){ | |
System.out.println(string); | |
} | |
} | |
public static void multiArgument2(String[] strings){ | |
for(String string : strings){ | |
System.out.println(string); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment