pass - Convert Kotlin Array to Java varargs
kotlin varargs constructor (1)
You should use the "
", which looks like this:
The spread operator needs to be prefixed to the array argument:
For further information, see the documentation :
When we call a
vararg-function, we can pass arguments one-by-one, e.g.
asList(1, 2, 3), or, if we already have an array and want to pass its contents to the function, we use the spread operator (prefix the array with
How can I convert my Kotlin
to a varargs Java
val angularRoutings = arrayOf<String>("/language", "/home") // this doesn't work web.ignoring().antMatchers(angularRoutings)