Listing 1: Static Initializers in Java.
public class Matrix {
private static int identityMatrix[8][8] =
new int[8][8];
static {
for (int i = 0; i < 8; i++)
for (int j = 0; j < 8; j++)
// initialize diagonal elements to 1
identityMatrix[i][j] = (i == j ? 1 : 0);
}
// ...
}