/* This is our Point class. */ public class Point { private int x; private int y; Point(int xVal, int yVal) { x = xVal; y = yVal; } int getX() { return x; } int getY() { return y; } void setX(int xVal) { x = xVal; } void setY(int yVal) { y = yVal; } } /* In this case of encapsulation, the attributes of the Point class have been declared private to prevent direct access to them - a form of "data hiding." The only way to access the attributes is via the class' accessor and mutator methods. Users would have no idea of the implementation; they just know the Point class has methods to manipulate data. */