public class Coordinates {
    private int row;
    private int col;

    public Coordinates(int row, int col) {
        if (row < 0 || col < 0) {
            throw new IllegalArgumentException("Row and col must be non-negative: (" + row + ", " + col + ")");
        }
        this.row = row;
        this.col = col;
    }//end constructor

    public int getRow() {
        return row;
    }//end getRow

    public int getCol() {
        return col;
    }//end getCol

    @Override
    public String toString() {       
        return "(" + row + ", " + col + ")";
    }//end toString   
}//end class Coordinates

