Representation
Rule of Thumb. Avoid using literal constants in the code; define and use symbolic constants.
Static class declarations visible to all methods.
class Knight {
/* Chess board B is N-by-N int array, for N == 8. */
final static int N = 8;
static int [][] B = new int [N][N];
/* Unvisited squares are Blank. */
static final int Blank = 0;
/* Board subscripts range from lo to hi. */
static final int lo = 0;
static final int hi = 7;
/* UNDEFINED, an illegal coordinate. */
static final int UNDEFINED = -1;
}