Suppose I have this in C++:
void test(int &i, int &j) { ++i; ++j; }
The values are altered inside the function and then use
The easiest solution is to use org.apache.commons.lang.mutable.MutableInt class you don't need to write by yourself.