I have a method in Java with this signature void setActiveProfiles(String... profiles), and in Java I can pass an array of string to this method. I want to call the method and pass it an Array[String], but I got Type mismatch error. And my question is what is the best and optimal way to convert Scala array to Java array?
This is the body of compilation error:
type mismatch;
 found   : Array[String]
 required: String
                I've found the answer and I've tested it, call method as setActiveProfiles(array:_*)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With