// Hunter Schafer, CSE 143 // This class shows an example of reference semantics import java.util.Arrays; public class PointClient { public static void main(String[] args) { int x = 5; Point p = new Point(1, 2); Point q = p; System.out.println("p start: " + p); System.out.println("q start: " + q); p.translate(4, 5); System.out.println("p before: " + p + ", q before: " + q); referenceTest(q); System.out.println("p after: " + p + ", q after: " + q); } public static void referenceTest(Point p) { // p references the same point passed to it! p.translate(5, 10); } }