Java generic function for performing calculations on integer, on double?
- by Daniel
Is this possible? Surely if you passed in a double, any sort of function implementation code which casts an object to an Integer would not be able to work unless the cast 'Integer' was specifically used? I have a function like:
public static void increment(Object o){
Integer one = (Integer)o;
system.out.println(one++);
}
I cant see how…