/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone {
private static class A {
public int i;
public A(int i) {
this.i = i;
}
}
public static void foo(A a) {
a.i += 2;
System.
out.
println("foo: " + a.
i); }
{
int j = 10;
System.
out.
println("main1: " + j
); A a = new A(j);
foo(a);
j = a.i;
System.
out.
println("main1: " + j
); }
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lIHsKCXByaXZhdGUgc3RhdGljIGNsYXNzIEEgewoJCXB1YmxpYyBpbnQgaTsKCQlwdWJsaWMgQShpbnQgaSkgewoJCQl0aGlzLmkgPSBpOwoJCX0KCX0KCglwdWJsaWMgc3RhdGljIHZvaWQgZm9vKEEgYSkgewoJCWEuaSArPSAyOwoJCVN5c3RlbS5vdXQucHJpbnRsbigiZm9vOiAiICsgYS5pKTsKCX0KCQoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpIHRocm93cyBqYXZhLmxhbmcuRXhjZXB0aW9uCgl7CgkJaW50IGogPSAxMDsKCQlTeXN0ZW0ub3V0LnByaW50bG4oIm1haW4xOiAiICsgaik7CgkJQSBhID0gbmV3IEEoaik7CgkJZm9vKGEpOwoJCWogPSBhLmk7CgkJU3lzdGVtLm91dC5wcmludGxuKCJtYWluMTogIiArIGopOwoJfQp9