In my java code I am using a method, let's call foo(), that returns a scala.Double[].
scala.Double[] arr = foo();
I want to sum up arr into a scala.Double, but am having trouble. I've found that doing any kind of math operation on scala.Doubles gets me an error message from my IDE:
arr[0] + arr[1];
arr[0] * arr[1];
//etc
get me messages like
Operator '+' cannot be applied to 'scala.Double', 'scala.Double'
How can I do math operations on scala.Doubles within java code? (alternatively, is there another way to sum up a scala.Double[] within java code?)