Kotlinのvaragr

Kotlinのvaragr

kotlinlang.org

ドキュメントによると「Variable number of arguments」の略らしい。
function(fun)に複数の変数を渡すことが可能と記載されています。

Javaなら下記のような感じです。 testMethodの (String... strs) 部分です。

    public static void main(String args[]) {
        testMethod("a1", "b1", "c1");
    }

    private static void testMethod(String... strs) {
        Arrays.stream(strs).forEach(System.out::println); // a1 b1 c1
    }