Object to Double[]
How to convert a Object into a Array of double?
How to convert a Object into a Array of double?
> How to convert a Object into a Array of double?
cast:
Object obj = ...;
double[] array = (double[]) obj;
Magic :p
You can't. If that object is already a Double[], you can cast it to a Double[], but only if the object is really a Double[]
Object a = getTheObjectFromWherever();
Double[] doubles = (Double[]) a;
But there isn't any converting going on
I figured the OP is a newbie. If he had been able to articulate his question with phrases like "object *reference*", he would have been experienced enough to know to use a cast. Let's let him try it out and come back with the result.
> > ah...the capital D(ouble) ...thx
>
> LOL
Babica,
Seriously, what are you trying to do? Why do you only have an Object reference instead of an array reference? Are you aware of the difference between Double and double? Which one is it in your case?
Yes i know the diference, Double is a wrapper.. and i'm trying to do a wrapping class for different kind of objects (different kinds of devices each with its own class but with similar functions) to make control of devices easyer for the user