private static String getArgValue(String[] argsString, int[] jIndex, String classTag) {
String thisToken;
for( ; jIndex[0]<argsString.length ; jIndex[0]++) {
System.out.println("jIndex[0]: " + jIndex[0]);
if (condition) {
// yadda yadda yadda
jIndex[0]++;
System.out.println("jIndex[0]: " + jIndex[0]);
return retString;
}
}
return retString;
}
我试过用数组和数组包装它,但都没有对原始变量Integer
进行更改。i
它是如何被调用的:
int[] j = new int[1];
for(int i=2; i< argsString.length; i++) {
// yadda yadda yadda
System.out.println("opening i: " + i);
j[0] = i;
thisArgValueString = getArgValue(argsString, j, thisArgClassString);
System.out.println("closing i: " + i);
}
示例输出:
opening i: 2
jIndex[0]: 2
jIndex[0]: 3
jIndex[0]: 5
closing i: 2