I am trying to determine if the unboxing method Java uses can be modified. The purpose of this is to be able to do:
class IInteger extends Integer {
@Override
public int unboxToPrimitive(){
return ++val;
}
}
IInteger i = 10;
System.out.print(i); // 11
That is, overloading the method and having it return ++val instead of val.