does `vararg args: Any?` mean that args is nullabl...
# getting-started
d
does
vararg args: Any?
mean that args is nullable or that null can be accepted as a var arg
👍 1
a
dumptruckman: it means args can contain nulls
d
Okay, thanks.
a
args itself wont be null, if you pass no arg it'll be an empty collection
d
what if i called the function with
args = null
?
a
in that case args is an array with just 1 element
and that element is null
``````
Copy code
fun test(vararg args: Any?) {
    println(args.size)
}

fun main(args: Array<String>) {
    test(args = null)
}
prints 1
d
hmm ok, thanks