Skip to content

Instantly share code, notes, and snippets.

@chingovan
Last active March 14, 2017 18:17
Show Gist options
  • Save chingovan/6486777167f2f2bb407be6a380101c16 to your computer and use it in GitHub Desktop.
Save chingovan/6486777167f2f2bb407be6a380101c16 to your computer and use it in GitHub Desktop.
public class ThreeRef {
public static void main(String[] argv) {
Point a = new Point();
a.setX(10);
Point b = a;
Point c = b;
System.out.println("a: " + a.getX() + ", b: " + b.getX() + ", c: " + c.getX());
b.setX(100);
System.out.println("a: " + a.getX() + ", b: " + b.getX() + ", c: " + c.getX());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment