(g) Suppose I define a type Point which contains two properties, x and y. The Point class has both getters
and setters defined on it which do the obvious thing of setting and getting x and y.
Remember that the get (int index) method defined on an ArrayList will return a reference to the
index element of the ArrayList.
import java.util.ArrayList;
public class ReferenceTest7
public static void methodSevenA (ArrayList coordinates)
Point first - coordinates.get(0);
first.set X (200.0);
public static void methodsevenB (ArrayList coordinates)
Point second = coordinates.get (1);
second = new Point (5.0,100.0);
second. setX (100);
public static void main(String[] args) {
ArrayList coordinates = new ArrayList();
coodinates.add(new Point (1.0,2.0));
coordinates.add(new Point(3.0, 4.0));
methodSevenA (coordinates);
methodSeven (coordinates);
System.out.println (coordinates.get (0).getX());
System.out.println (coordinates.get (1).getX());
1/WHAT IS PRINTED TO THE SCREEN? (ANSWER IN CHART)