What are the x- and y-coordinates of the Point
s referred to as p1
, p2
, and p3
after the following code executes?
Give your answer as an x-y pair such as (0, 0).
(Recall that Point
s and other objects use reference semantics.
Point p1 = new Point(); p1.x = 17; p1.y = 9; Point p2 = new Point(); p2.x = 4; p2.y = -1; Point p3 = p2; p1.translate(3, 1); p2.x = 50; p3.translate(-4, 5); |
|