@SlyEcho said:
@APH said:For those unfamiliar with Java, this should probably be implemented as:
if(object instanceof java.lang.Double) {
double d= ((java.lang.Double)object).doubleValue(); //not necessary with auto-boxing in Java 1.5 or greater
//do some stuff with d
}
I'd use java.lang.Number instead of java.lang.Double.
And that's why you'd be wrong. Maybe, just maybe, you'd want to treat Integers, Doubles, and BigDecimals differently?