public class One { public Two get() { return two; } public void set(Two theTwo) { two = theTwo; } private Two two; } public class Two { public One get() { return one; } public void set(One theOne) { one = theOne; } private One one; public static void main(String[] args) { One o1 = new One(); Two o2 = new Two(); o1.set(o2); o2.set(o1); if (o1.get().get() == o1) { System.out.println("Yes"); } } }
Yes
Select the most appropriate answer.