java code
public void insertRow(Object... fieldList) {
for(int i = 0; i < fieldList.length; i++) {
System.out.println(fieldList[i]);
}
}
Scala code
def main(args: Array[String]) {
insertRow(args)
}
As show above, I want to call a method which write in java and has a non-fixed parameters. when I pass parameter in scala Array, it the fieldList.length is always 1 and just get the whole args not the element in scala array. so could someone tell me how to convert a scala array to java or how to pass a scala array to java ?
insertRow(args: _*)