Casting int to double

Does anyone know the best way to cast an int to a double performance wise? 1) Integer newx = new Integer( x );double tick = newx.doubleValue();or 2) int i = 3;double tick = Double.parseDouble(Integer.toString( i ) );
[265 byte] By [edhady] at [2007-9-26 2:34:43]
# 1
performance is always quicker when you use primitive data types rather then Objects, so the quickest way is,int x = 0;float f = (float)x;
rvflannery at 2007-6-29 9:59:50 > top of Java-index,Archived Forums,Java Programming...
# 2
int i = 3;double tick = i; It's really that simple!
schapel at 2007-6-29 9:59:50 > top of Java-index,Archived Forums,Java Programming...