Page 569 - AP Computer Science A, 7th edition
P. 569

 Since contestants may be moved around during the competition, each contestant keeps track of his or her location, which is the row number and column number. A Location object is represented by the class below.
public class Location {
private int rowNumber; private int colNumber;
/∗ ∗ Create a new Location.
∗ @param row the row number
∗ @param col the column number ∗/
public Location (int row, int col) {
rowNumber = row;
colNumber = col; }
/∗∗ @return the row number of this Location ∗/
public int getRowNumber()
{ return rowNumber; }
/∗∗ @return the column number of this Location






















































































   567   568   569   570   571