public class B {
    public void m() {
        A a = new A();
        // Note that the object executing the method is of class B
        // while a is an object of class A that is different from B.
        int tmp1 = a.x; // denied because of that
        int tmp2 = a.y;
    }
}