Skip to content

Instantly share code, notes, and snippets.

@msridhar
Created April 21, 2013 17:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save msridhar/5430409 to your computer and use it in GitHub Desktop.
Save msridhar/5430409 to your computer and use it in GitHub Desktop.
class A {
A f;
void m() {
this.f = this;
}
}
main() {
A x = new A(); // a1
A y = new A(); // a2
boolean p = ???;
A z = p ? x : y; // z -> {a1, a2}
z.m(); // a1.f -> a1, a2.f -> a2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment