大家好,首先看一下下面这段代码:
ublic class fillTheGaps {
int foo(String x, int number, int[] array){
number = array.length;
x = x + "xAtfoo";
for (int i=0; i < number; i++){
array[i] = array[i] + x.length();
}
x = x + "Success";
return x.length();
}
void bar(){
String s = new String("Hello");
int num = 6;
int [] array = {1, 2, 3, 4};
int result = 0;
result = foo(s, num, array);
}
public static void main (String[] args){
fillTheGaps ftp=new fillTheGaps();
ftp.bar();
System.out.println();
}
}
假设,我们调用方法bar(),填写执行方法result=foo(s,num,array)之前和之后的变量的值。