public class S {
int v = 10;
public int update(int v) {
v = v + 5;
this.v = this.v + v;
return v;
}
}
public static int run() {
S s = new S();
int r = s.update(3);
return r + s.v;
}
// Call: System.out.println(run());What is printed?
- Acheck_circle
26
- B
21
- C
18
- D
23
Explanation
Local v=3, then v+5=8. this.v = 10 + 8 = 18. Returns 8. r + s.v = 8 + 18 = 26.