I have a function in a jar file which accepts two parameters:
- An Object array which mentions the type and number of output
- An Object array which contains input to the function.
The input I need to pass consists of 7 objects. I have to send two double[]
arrays and rest all 5 are double values.
I would like to know how to convert double[]
into an Object
.
Please help me with this.
If i want to convert a single double value to an object of Double, I can use the following code.
public class JavadoubleToDoubleExample {
public static void main(String[] args) {
double d = 10.56;
/*
Use Double constructor to convert double primitive type to a Double object.
*/
Double dObj = new Double(d);
System.out.println(dObj);
}
}
Output:
10.56
But what if the d={1.0,8.9,4.0,7.9}
.
How can I convert the array into an object of Double
?