People, this is all my code is. I am trying to change an Integer Object to a primitive int, to use them in the getValue and Compute(Integer i) methods
. Compiler Says NO..
I have tried both the solutions below ... and got the following errors
i.intValue(); // no method intValue in Integer
Integer sum = new Integer("s"); //cannot isntatiate an integer.
I just formatted my computer and installed eclipse 3.5.2
I'm not sure if i'm doing anything wrong..but is there a library that i should install..my solutions seem logical to me .what is going on here?
public class FunctorAdd<Integer> implements Functor<Integer> {
private int sum;
@Override
public Integer getValue() {
return sum;
}
@Override
public void compute(Integer i) {
sum += i.intVlaue();
// TODO Auto-generated method stub
}
}