/* This immutable class represents ordered pairs of integers. */ public class IntegerPair { private int first; // the first integer of the pair private int second; // the second integer of the pair /** This constructor bundles two given integers into an IntegerPair @param f the first integer @param s the second integer */ public IntegerPair(int f, int s) { first = f; second = s; } /** @return the first integer of the pair */ public int getFirst() { return first; } /** @return the second integer of the pair */ public int getSecond() { return second; } /** @return a string representing the pair in conventional ordered pair notation */ public String toString() { return "(" + first + "," + second + ")"; } }